コード例 #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
 public VBucketKeyMapperFactory(IVBucketFactory vBucketFactory)
 {
     _vBucketFactory = vBucketFactory ?? throw new ArgumentNullException(nameof(vBucketFactory));
 }