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