扩展了redisson 2.x版本 添加可计数布隆过滤器
<dependency>
<groupId>com.github.slacrey</groupId>
<artifactId>redisson-extend</artifactId>
<version>1.1.2150</version>
</dependency>
Config config = new Config();
config.useSingleServer().setAddress("redis://127.0.0.1:6379");
RedissonClientExtend redissonClientExtend = RedissonExtend.create(config);
RCountingBloomFilter<String> bloomFilter = redissonClientExtend.getCountingBloomFilter("test2", 3);
getCountingBloomFilter(name, repeat)
- name 过滤器名称
- repeat 可重复次数
bloomFilter.tryInit(10000, 0.0001D);
boolean tryInit(long expectedInsertions, double falseProbability);
- expectedInsertions 容量
- falseProbability 错误率
bloomFilter.add("test1");
bloomFilter.contains("test1")
bloomFilter.remove("test1")