/// <summary> /// Initializes a new instance of the <see cref="FilterRedis{T}"/> class. /// </summary> /// <param name="name"></param> /// <param name="redisBitOperate">The redis bit operate.</param> /// <param name="redisKey">The redisKey.</param> /// <param name="capacity">The capacity.</param> /// <param name="hashes">The hashes.</param> /// <param name="hashFunction">The hash function.</param> public FilterRedis(string name, IRedisBitOperate redisBitOperate, string redisKey, int capacity, int hashes, HashFunction hashFunction) : base(name, capacity, hashes, hashFunction) { if (string.IsNullOrWhiteSpace(redisKey)) { throw new ArgumentException(nameof(redisKey)); } _redisBitOperate = redisBitOperate ?? throw new ArgumentNullException(nameof(redisBitOperate)); _redisKey = redisKey; }
/// <summary> /// Initializes a new instance of the <see cref="FilterRedis{T}"/> class. /// </summary> /// <param name="name"></param> /// <param name="redisBitOperate">The redis bit operate.</param> /// <param name="redisKey">The redisKey.</param> /// <param name="expectedElements">The expected elements.</param> /// <param name="errorRate">The error rate.</param> /// <param name="hashFunction">The hash function.</param> public FilterRedis(string name, IRedisBitOperate redisBitOperate, string redisKey, int expectedElements, double errorRate, HashFunction hashFunction) : base(name, expectedElements, errorRate, hashFunction) { if (string.IsNullOrWhiteSpace(redisKey)) { throw new ArgumentException(nameof(redisKey)); } _redisBitOperate = redisBitOperate ?? throw new ArgumentNullException(nameof(redisBitOperate)); _redisKey = redisKey; }
/// <summary> /// Creates a BloomFilter Redis for the specified expected element /// </summary> /// <typeparam name="T"></typeparam> /// <param name="redisBitOperate">The redis bit operate.</param> /// <param name="redisKey">The redis key.</param> /// <param name="expectedElements">The expected elements.</param> /// <param name="errorRate">The error rate.</param> /// <param name="hashFunction">The hash function.</param> /// <returns></returns> public static Filter <T> Build <T>(IRedisBitOperate redisBitOperate, string redisKey, int expectedElements, double errorRate, HashFunction hashFunction) { return(new FilterRedis <T>(redisBitOperate, redisKey, expectedElements, errorRate, hashFunction)); }
/// <summary> /// Creates a BloomFilter Redis for the specified expected element /// </summary> /// <typeparam name="T"></typeparam> /// <param name="redisBitOperate">The redis bit operate.</param> /// <param name="redisKey">The redis key.</param> /// <param name="expectedElements">The expected elements.</param> /// <returns></returns> public static Filter <T> Build <T>(IRedisBitOperate redisBitOperate, string redisKey, int expectedElements) { return(Build <T>(redisBitOperate, redisKey, expectedElements, 0.01, HashFunctions[HashMethod.Murmur3KirschMitzenmacher])); }
/// <summary> /// Creates a BloomFilter Redis for the specified expected element /// </summary> /// <typeparam name="T"></typeparam> /// <param name="redisBitOperate">The redis bit operate.</param> /// <param name="redisKey">The redis key.</param> /// <param name="expectedElements">The expected elements.</param> /// <param name="hashFunction">The hash function.</param> /// <returns></returns> public static Filter <T> Build <T>(IRedisBitOperate redisBitOperate, string redisKey, int expectedElements, HashFunction hashFunction) { return(Build <T>(redisBitOperate, redisKey, expectedElements, 0.01, hashFunction)); }
/// <summary> /// Initializes a new instance of the <see cref="FilterRedis"/> class. /// </summary> /// <param name="name"></param> /// <param name="redisBitOperate">The redis bit operate.</param> /// <param name="redisKey">The name.</param> /// <param name="capacity">The capacity.</param> /// <param name="hashes">The hashes.</param> /// <param name="hashFunction">The hash function.</param> public FilterRedis(string name, IRedisBitOperate redisBitOperate, string redisKey, int capacity, int hashes, HashFunction hashFunction) : base(name, redisBitOperate, redisKey, capacity, hashes, hashFunction) { }
/// <summary> /// Initializes a new instance of the <see cref="FilterRedis"/> class. /// </summary> /// <param name="name"></param> /// <param name="redisBitOperate">The redis bit operate.</param> /// <param name="redisKey">The name.</param> /// <param name="expectedElements">The expected elements.</param> /// <param name="errorRate">The error rate.</param> /// <param name="hashFunction">The hash function.</param> public FilterRedis(string name, IRedisBitOperate redisBitOperate, string redisKey, int expectedElements, double errorRate, HashFunction hashFunction) : base(name, redisBitOperate, redisKey, expectedElements, errorRate, hashFunction) { }
public static Filter <T> Build <T>(IRedisBitOperate redisBitOperate, string redisKey, int expectedElements, double errorRate, HashFunction hashFunction, string name = BloomFilterConstValue.DefaultRedisName) { return(new FilterRedis <T>(name, redisBitOperate, redisKey, expectedElements, errorRate, hashFunction)); }
public static Filter <T> Build <T>(IRedisBitOperate redisBitOperate, string redisKey, int expectedElements, string name = BloomFilterConstValue.DefaultRedisName) { return(Build <T>(redisBitOperate, redisKey, expectedElements, 0.01, HashFunction.Functions[HashMethod.Murmur3KirschMitzenmacher], name)); }
public static Filter <T> Build <T>(IRedisBitOperate redisBitOperate, string redisKey, int expectedElements, HashFunction hashFunction, string name = BloomFilterConstValue.DefaultRedisName) { return(Build <T>(redisBitOperate, redisKey, expectedElements, 0.01, hashFunction, name)); }
/// <summary> /// Creates a BloomFilter Redis for the specified expected element /// </summary> /// <param name="redisBitOperate">The redis bit operate.</param> /// <param name="redisKey">The redis key.</param> /// <param name="expectedElements">The expected elements.</param> /// <param name="errorRate">The error rate.</param> /// <param name="hashMethod">The hash method.</param> /// <param name="name"></param> /// <returns></returns> public static IBloomFilter Build(IRedisBitOperate redisBitOperate, string redisKey, int expectedElements, double errorRate, HashMethod hashMethod, string name = BloomFilterConstValue.DefaultRedisName) { return(new FilterRedis(name, redisBitOperate, redisKey, expectedElements, errorRate, HashFunction.Functions[hashMethod])); }
/// <summary> /// Creates a BloomFilter Redis for the specified expected element /// </summary> /// <param name="redisBitOperate">The redis bit operate.</param> /// <param name="redisKey">The redis key.</param> /// <param name="expectedElements">The expected elements.</param> /// <param name="hashMethod">The hash method.</param> /// <param name="name"></param> /// <returns></returns> public static IBloomFilter Build(IRedisBitOperate redisBitOperate, string redisKey, int expectedElements, HashMethod hashMethod, string name = BloomFilterConstValue.DefaultRedisName) { return(Build(redisBitOperate, redisKey, expectedElements, 0.01, hashMethod, name)); }
/// <summary> /// Initializes a new instance of the <see cref="FilterRedis{T}"/> class. /// </summary> /// <param name="redisBitOperate">The redis bit operate.</param> /// <param name="name">The name.</param> /// <param name="capacity">The capacity.</param> /// <param name="hashes">The hashes.</param> /// <param name="hashFunction">The hash function.</param> public FilterRedis(IRedisBitOperate redisBitOperate, string name, int capacity, int hashes, HashFunction hashFunction) : base(capacity, hashes, hashFunction) { _redisBitOperate = redisBitOperate; _name = name; }
/// <summary> /// Initializes a new instance of the <see cref="FilterRedis{T}"/> class. /// </summary> /// <param name="redisBitOperate">The redis bit operate.</param> /// <param name="name">The name.</param> /// <param name="expectedElements">The expected elements.</param> /// <param name="errorRate">The error rate.</param> /// <param name="hashFunction">The hash function.</param> public FilterRedis(IRedisBitOperate redisBitOperate, string name, int expectedElements, double errorRate, HashFunction hashFunction) : base(expectedElements, errorRate, hashFunction) { _redisBitOperate = redisBitOperate; _name = name; }