Skip to content

HBASE-29842 Add Ribbon Filter as an alternative to Bloom Filter - #7653

Open
Jaehui-Lee wants to merge 9 commits into
apache:masterfrom
Jaehui-Lee:HBASE-29842
Open

HBASE-29842 Add Ribbon Filter as an alternative to Bloom Filter#7653
Jaehui-Lee wants to merge 9 commits into
apache:masterfrom
Jaehui-Lee:HBASE-29842

Conversation

@Jaehui-Lee

Copy link
Copy Markdown
Contributor

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache9Apache9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me I prefer we introduce a new configuration which indicates the bloom filter implementation? The current BloomType just indicates that how we want to apply the bloom filter, not the implementation of the bloom filter itself.

@Jaehui-Lee

Copy link
Copy Markdown
ContributorAuthor

For me I prefer we introduce a new configuration which indicates the bloom filter implementation? The current BloomType just indicates that how we want to apply the bloom filter, not the implementation of the bloom filter itself.

@Apache9

Thank you for the review! I've added a new BloomFilterImpl enum (BLOOM/RIBBON) separate from BloomType, with per-table (BLOOMFILTER_IMPL) and global (io.storefile.bloom.filter.impl) configuration support.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Jaehui-Lee

Copy link
Copy Markdown
ContributorAuthor

Hi @Apache9, friendly bump. Please let me know if there are any further changes needed. Thanks!

@Apache9Apache9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the ribbon filter implementation in this PR is implemented from scratch?

if (bloomType == BloomType.ROWCOL) {
err = (float) (1 - Math.sqrt(1 - err));
// Check if Ribbon filter is requested
if (bloomImpl == BloomFilterImpl.RIBBON) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better use switch case here? we could have other bloom implementation in the future.

return createRibbonFilterAtWrite(conf, cacheConf, bloomType, writer);
}

float err = (float) getAdjustedErrorRate(conf, bloomType);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also extract the below code to a method called createTraditionalBloomFilter?

family, region.getManagedKeyDataCache(), region.getSystemKeyCache()))
.withBloomType(family.getBloomFilterType()).withCacheConfig(createCacheConf(family))
.withBloomType(family.getBloomFilterType())
.withBloomFilterImpl(BloomFilterFactory.getBloomFilterImpl(conf, family))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why here we can not call family.getBloomFilterImpl directly, like the above for BloomType?

@Jaehui-Lee

Jaehui-Lee commented Feb 2, 2026

Copy link
Copy Markdown
ContributorAuthor

@Apache9 Thank you for the review!

I've addressed your feedback:

  • 1e6152e
  • 237dce2
    • The global configuration (io.storefile.bloom.filter.impl) was effectively dead code, and column family level configuration should be sufficient for now, so I removed it.

So the ribbon filter implementation in this PR is implemented from scratch?

Yes, this is implemented from scratch based on:

  1. The original Ribbon Filter paper
  2. The reference implementation in here by the paper authors

@Apache-HBase

This comment has been minimized.

@Apache9

Copy link
Copy Markdown
Contributor

@Apache9 Thank you for the review!

I've addressed your feedback:

  • 1e6152e

  • 237dce2

    • The global configuration (io.storefile.bloom.filter.impl) was effectively dead code, and column family level configuration should be sufficient for now, so I removed it.

So the ribbon filter implementation in this PR is implemented from scratch?

Yes, this is implemented from scratch based on:

  1. The original Ribbon Filter paper
  2. The reference implementation in here by the paper authors

Although we do not use the code directly, I still think we'd better mention this reference implementation at least in the javadoc of our implementation class. The reference implementation is licensed under Apache 2.0, which should be fine.

@Jaehui-Lee

Copy link
Copy Markdown
ContributorAuthor

Although we do not use the code directly, I still think we'd better mention this reference implementation at least in the javadoc of our implementation class. The reference implementation is licensed under Apache 2.0, which should be fine.

6dabb24 Added the reference implementation link to the ribbon package javadoc. Thanks!

@Apache-HBase

This comment has been minimized.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 12sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+0 🆗codespell0m 0scodespell was not available.
+0 🆗detsecrets0m 0sdetect-secrets was not available.
+0 🆗shelldocs0m 0sShelldocs was not available.
+1 💚@author0m 0sThe patch does not contain any @author tags.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
_ master Compile Tests _
+0 🆗mvndep0m 11sMaven dependency ordering for branch
+1 💚mvninstall2m 29smaster passed
+1 💚compile6m 19smaster passed
+1 💚checkstyle1m 46smaster passed
+1 💚spotbugs8m 13smaster passed
+0 🆗refguide1m 31sbranch has no errors when building the reference guide. See footer for rendered docs, which you should manually inspect.
+1 💚spotless0m 39sbranch has no errors when running spotless:check.
_ Patch Compile Tests _
+0 🆗mvndep0m 11sMaven dependency ordering for patch
+1 💚mvninstall2m 14sthe patch passed
+1 💚compile6m 24sthe patch passed
+1 💚javac6m 24sthe patch passed
+1 💚blanks0m 0sThe patch has no blanks issues.
+1 💚checkstyle1m 43sthe patch passed
+1 💚shellcheck0m 0sNo new issues.
+1 💚spotbugs8m 31sthe patch passed
+0 🆗refguide1m 26spatch has no errors when building the reference guide. See footer for rendered docs, which you should manually inspect.
+1 💚hadoopcheck8m 32sPatch does not cause any errors with Hadoop 3.3.6 3.4.1.
+1 💚spotless0m 34spatch has no errors when running spotless:check.
_ Other Tests _
+1 💚asflicense0m 30sThe patch does not generate ASF License warnings.
57m 22s
SubsystemReport/Notes
DockerClientAPI=1.53 ServerAPI=1.53 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7653/7/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#7653
Optional Testsdupname asflicense codespell detsecrets shellcheck shelldocs spotless javac spotbugs checkstyle compile hadoopcheck hbaseanti refguide
unameLinux cecbfc58bbee 6.14.0-1018-aws #18~24.04.1-Ubuntu SMP Mon Nov 24 19:46:27 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 6dabb24
Default JavaEclipse Adoptium-17.0.11+9
refguidehttps://nightlies.apache.org/hbase/HBase-PreCommit-GitHub-PR/PR-7653/7/yetus-general-check/output/branch-site/book.html
refguidehttps://nightlies.apache.org/hbase/HBase-PreCommit-GitHub-PR/PR-7653/7/yetus-general-check/output/patch-site/book.html
Max. process+thread count189 (vs. ulimit of 30000)
modulesC: hbase-client hbase-server hbase-thrift . U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7653/7/console
versionsgit=2.34.1 maven=3.9.8 spotbugs=4.7.3 shellcheck=0.8.0
Powered byApache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@Jaehui-Lee@Apache-HBase@Apache9