1 Star 3 Fork 0

slacrey / redisson-extend

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
readme.md

Getting Started

Reference Documentation

扩展了redisson 2.x版本 添加可计数布隆过滤器

引入依赖包

<dependency>
  <groupId>com.github.slacrey</groupId>
  <artifactId>redisson-extend</artifactId>
  <version>1.1.2150</version>
</dependency>

创建Redisson连接

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")

Comments ( 0 )

Sign in for post a comment

About

No description spread retract
Java
Apache-2.0
Cancel

Releases

No release

Contributors

All

Activities

load more
can not load any more
Java
1
https://gitee.com/slacrey/redisson-extend.git
git@gitee.com:slacrey/redisson-extend.git
slacrey
redisson-extend
redisson-extend
master

Search