Skip to content

HBASE-30020 Introduce cache placement and admission policy API#8184

Open
VladRodionov wants to merge 1 commit intoapache:HBASE-30018from
VladRodionov:HBASE-30020-placement-admission-policy
Open

HBASE-30020 Introduce cache placement and admission policy API#8184
VladRodionov wants to merge 1 commit intoapache:HBASE-30018from
VladRodionov:HBASE-30020-placement-admission-policy

Conversation

@VladRodionov
Copy link
Copy Markdown
Contributor

This PR targets the HBASE-30018 feature branch.

Introduces the cache placement/admission policy layer for the pluggable block cache architecture.

Adds:

  • CachePlacementAdmissionPolicy
  • AdmissionDecision
  • AdmissionPriority
  • TierDecision
  • PromotionDecision
  • RepresentationDecision
  • CacheRequestContext
  • CacheWriteContext
  • CacheWriteSource
  • DefaultHBaseCachePlacementAdmissionPolicy

The default policy preserves current HBase behavior:

  • admission is allowed by default after existing CacheConfig decisions
  • metadata/index/bloom blocks prefer L1, with fallback to L2
  • data blocks prefer L2, with fallback to L1
  • representation preserves current HBase behavior
  • no promotion by default

No read/write path migration is included in this PR.
No behavior change intended.

JIRA: HBASE-30020

Copy link
Copy Markdown
Contributor

@petersomogyi petersomogyi left a comment

Choose a reason for hiding this comment

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

LGTM. Clean API design with good Javadocs.

Comment on lines +50 to +54
public static RepresentationDecision of(RepresentationKind kind) {
return kind == RepresentationKind.CURRENT_HBASE_DEFAULT
? CURRENT_HBASE_DEFAULT
: new RepresentationDecision(kind);
}
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.

I'm not sure if this will be on a hot path but if so then you can cache all 4 RepresentationKind instances since the enum is small and fixed.

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.

This class seems redundant with RepresentationKind, is it planned to implement any additional logic in the future? Otherwise, can these two just be merged?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yep, looks over engineered. Will remove it.

Comment on lines +50 to +54
public static RepresentationDecision of(RepresentationKind kind) {
return kind == RepresentationKind.CURRENT_HBASE_DEFAULT
? CURRENT_HBASE_DEFAULT
: new RepresentationDecision(kind);
}
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.

This class seems redundant with RepresentationKind, is it planned to implement any additional logic in the future? Otherwise, can these two just be merged?

@VladRodionov VladRodionov force-pushed the HBASE-30020-placement-admission-policy branch from 6a3b1be to 57513fc Compare May 6, 2026 00:45
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.

3 participants