Skip to content

HBASE-30394 Report data block size and count separately in TinyLfuBlockCache - #8666

Open
Huginn-kio wants to merge 1 commit into
apache:masterfrom
Huginn-kio:HBASE-30394
Open

Huginn-kio wants to merge 1 commit into
apache:masterfrom
Huginn-kio:HBASE-30394

Conversation

@Huginn-kio

Copy link
Copy Markdown
Contributor

HBASE-30394

Summary

TinyLfuBlockCache currently exposes aggregate cache size and entry count through
the data-block-specific BlockCache methods. This PR tracks data-block size and
count separately.

See HBASE-30394.

Root cause

getCurrentDataSize() delegates to getCurrentSize() and
getDataBlockCount() delegates to getBlockCount(). Insert and removal paths
do not maintain data-only counters, so index and metadata blocks are included.

Fix

  • Track aligned heap size and count for blocks whose BlockType is data.
  • Update both counters on cache insertion, explicit eviction, and listener eviction.
  • Return the data-only counters from the existing BlockCache methods.

Testing

  • git diff --check
  • JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home mvn -pl hbase-server -am -DskipTests checkstyle:check -Dcheckstyle.includes='**/io/hfile/TinyLfuBlockCache.java'
  • JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home mvn -pl hbase-server -am -DskipTests -Dcheckstyle.skip -Drat.skip -Dspotbugs.skip compile
  • No new regression test was added; this PR contains the focused implementation fix.

Compatibility

  • Public API impact: none; this uses existing BlockCache methods.
  • Config impact: none.
  • Persisted and wire format impact: none.

Sign up for free to 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.

1 participant