VladRodionov commented on code in PR #8903:
URL: https://github.com/apache/hbase/pull/8903#discussion_r4745873177
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/cache/AdaptiveLruCachePlacementAdmissionPolicy.java:
##########
@@ -121,29 +119,32 @@ public
AdaptiveLruCachePlacementAdmissionPolicy(Configuration conf) {
* @param block block to cache
* @param context cache write context
* @param priority admission priority
+ * @param tier cache tier being evaluated for admission
* @param topologyView read-only topology view
* @return admission decision
*/
@Override
public AdmissionDecision shouldAdmit(BlockCacheKey cacheKey, Cacheable block,
- CacheWriteContext context, AdmissionPriority priority, CacheTopologyView
topologyView) {
+ CacheWriteContext context, AdmissionPriority priority, CacheTier tier,
+ CacheTopologyView topologyView) {
Objects.requireNonNull(cacheKey, "cacheKey must not be null");
Objects.requireNonNull(block, "block must not be null");
Objects.requireNonNull(context, "context must not be null");
Objects.requireNonNull(priority, "priority must not be null");
+ Objects.requireNonNull(tier, "tier must not be null");
Objects.requireNonNull(topologyView, "topologyView must not be null");
AdmissionDecision decision =
- DELEGATE.shouldAdmit(cacheKey, block, context, priority, topologyView);
+ DELEGATE.shouldAdmit(cacheKey, block, context, priority, tier,
topologyView);
if (!decision.isAdmitted()) {
return decision;
}
if (
- topologyView.getType() == CacheTopologyType.SINGLE_TIER
+ (tier == CacheTier.SINGLE || tier == CacheTier.L1)
Review Comment:
On a most recent Clause review comment...
Restored the original single-tier placement semantics without reintroducing
a separate insertion path.
For `SINGLE_TIER` topologies, the service now selects `CacheTier.SINGLE`
directly, bypassing `selectTier()`, while retaining the common per-tier
admission and insertion logic.
Updated the existing single-tier tests to verify that `selectTier()` is
never invoked, admission is evaluated for `CacheTier.SINGLE`, and both
admission and rejection behavior are preserved.
This also avoids silently skipping cache insertion due to an incorrect
placement decision. No tier remapping or additional metrics are necessary for
this fix.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]