Пример #1
0
        //for log redaction
        // private Func<object, string> User = RedactableArgument.UserAction;

        public VBucketKeyMapper(BucketConfig config, VBucketServerMap vBucketServerMap, IVBucketFactory vBucketFactory)
        {
            if (config == null)
            {
                ThrowHelper.ThrowArgumentNullException(nameof(config));
            }
            if (vBucketServerMap == null)
            {
                ThrowHelper.ThrowArgumentNullException(nameof(vBucketServerMap));
            }
            if (vBucketFactory == null)
            {
                ThrowHelper.ThrowArgumentNullException(nameof(vBucketFactory));
            }

            _vBucketFactory = vBucketFactory;

            Rev = config.Rev;
            _vBucketServerMap = vBucketServerMap;
            _endPoints        = _vBucketServerMap.IPEndPoints;
            _bucketName       = config.Name;
            _vBuckets         = CreateVBucketMap();
            _vForwardBuckets  = CreateVBucketMapForwards();
            _mask             = (short)(_vBuckets.Count - 1);
        }
Пример #2
0
        //for log redaction
        // private Func<object, string> User = RedactableArgument.UserAction;

        public VBucketKeyMapper(BucketConfig config, VBucketServerMap vBucketServerMap, IVBucketFactory vBucketFactory)
        {
            if (config == null)
            {
                ThrowHelper.ThrowArgumentNullException(nameof(config));
            }
            if (vBucketServerMap == null)
            {
                ThrowHelper.ThrowArgumentNullException(nameof(vBucketServerMap));
            }
            if (vBucketFactory == null)
            {
                ThrowHelper.ThrowArgumentNullException(nameof(vBucketFactory));
            }

            _vBucketFactory = vBucketFactory;

            Rev = config.Rev;
            _vBucketServerMap = vBucketServerMap;
            _endPoints        = _vBucketServerMap.EndPoints;
            _bucketName       = config.Name;
            _vBuckets         = CreateVBucketMap();
            _vForwardBuckets  = CreateVBucketMapForwards();

            // Cache the mask for reuse as an optimization
            _mask = VBucketMapper.GetMask(_vBuckets.Count);
        }
Пример #3
0
        //for log redaction
        // private Func<object, string> User = RedactableArgument.UserAction;

        public VBucketKeyMapper(BucketConfig config)
        {
            Rev = config.Rev;
            _vBucketServerMap = config.VBucketServerMap;
            _endPoints        = _vBucketServerMap.IPEndPoints;
            _bucketName       = config.Name;
            _vBuckets         = CreateVBucketMap();
            _vForwardBuckets  = CreateVBucketMapForwards();
            _mask             = (short)(_vBuckets.Count - 1);
        }
Пример #4
0
 public VBucket(ICollection <IPEndPoint> endPoints, short index, short primary, short[] replicas, uint rev,
                VBucketServerMap vBucketServerMap, string bucketName)
 {
     _endPoints        = endPoints;
     Index             = index;
     Primary           = primary;
     _replicas         = replicas;
     Rev               = rev;
     _vBucketServerMap = vBucketServerMap;
     BucketName        = bucketName;
 }
Пример #5
0
 public VBucket(ICollection <IPEndPoint> endPoints, short index, short primary, short[] replicas, uint rev,
                VBucketServerMap vBucketServerMap, string bucketName, ILogger <VBucket> logger)
 {
     _endPoints        = endPoints;
     Index             = index;
     Primary           = primary;
     _replicas         = replicas;
     Rev               = rev;
     _vBucketServerMap = vBucketServerMap;
     BucketName        = bucketName;
     _logger           = logger ?? throw new ArgumentNullException(nameof(logger));
 }
Пример #6
0
        public VBucket(ICollection <HostEndpointWithPort> endPoints, short index, short primary, short[] replicas, ulong rev,
                       VBucketServerMap vBucketServerMap, string bucketName, ILogger <VBucket> logger)
        {
            if (logger == null)
            {
                ThrowHelper.ThrowArgumentNullException(nameof(logger));
            }

            _endPoints        = endPoints;
            Index             = index;
            Primary           = primary;
            _replicas         = replicas;
            Rev               = rev;
            _vBucketServerMap = vBucketServerMap;
            BucketName        = bucketName;
            _logger           = logger;
        }