CountingBloomFilter 正在参加 2021 年度 OSC 中国开源项目评选,请投票支持!
CountingBloomFilter 在 2021 年度 OSC 中国开源项目评选 中已获得 {{ projectVoteCount }} 票,请投票支持!
2021 年度 OSC 中国开源项目评选 正在火热进行中,快来投票支持你喜欢的开源项目!
2021 年度 OSC 中国开源项目评选 >>> 中场回顾
CountingBloomFilter 获得 2021 年度 OSC 中国开源项目评选「最佳人气项目」 !
授权协议 Apache
开发语言 Java
操作系统 跨平台
软件类型 开源软件
所属分类 程序开发常用工具包
开源组织
地区 国产
投 递 者 产奶的蜗牛
适用人群 未知
收录时间 2020-06-15

软件简介

这是一个redisson实现的可删除布隆过滤器

引入依赖包

<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")
展开阅读全文

代码

的 Gitee 指数为
超过 的项目

评论

点击引领话题📣
暂无内容
发表了博客
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
发表了问答
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
暂无内容
0 评论
5 收藏
分享
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部