Closed smitchelus closed 10 years ago
Hi, thanks for raising the issue. The problem you describe is in fact present, as every Bloomfilter will use the same keys. I will fix it soon.
Cool, thanks!
I have submitted a pull request with this feature (Scott and I work together).
The feature is now implemented using the Builder, Bloom filter can now be assigned names, that will be used to distinguish them:
String host = "localhost";
int port = 6379;
String filterName = "normalbloomfilter";
//Open a Redis-backed Bloom filter
BloomFilter<String> bfr = new FilterBuilder(1000, 0.01)
.name(filterName) //use a distinct name
.redisBacked(true)
.redisHost(host) //Default is localhost
.redisPort(port) //Default is standard 6379
.buildBloomFilter();
bfr.add("cow");
//Open the same Bloom filter from anywhere else
BloomFilter<String> bfr2 = new FilterBuilder(1000, 0.01)
.name(filterName) //load the same filter
.redisBacked(true)
.buildBloomFilter();
bfr2.add("bison");
print(bfr.contains("cow")); //true
print(bfr.contains("bison")); //true
Hi, I'm attempting to use your Redis backed bloomfilter, but it appears that it always stores the filter under a hardcoded key called "normalbloomfilter". How can I have a second bloom filter without overwriting the first one?