taklwu commented on code in PR #8184:
URL: https://github.com/apache/hbase/pull/8184#discussion_r3197654376


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/cache/PromotionAction.java:
##########
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.io.hfile.cache;
+
+import org.apache.yetus.audience.InterfaceAudience;
+
+/**
+ * Promotion action selected by cache placement policy.
+ */
[email protected]
+public enum PromotionAction {

Review Comment:
   nit: will we have a demotion action ? IIRC that we may have block moving 
from L1 -> L2, ,if so and if need to record it, where should we action be 
annotated ?  



##########
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/cache/CacheRequestContext.java:
##########
@@ -0,0 +1,187 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.io.hfile.cache;
+
+import org.apache.hadoop.hbase.io.hfile.BlockType;
+import org.apache.yetus.audience.InterfaceAudience;
+
+/**
+ * Context for cache lookup.
+ * <p>
+ * This object carries read-path cache lookup intent. It mirrors the existing 
low-allocation
+ * BlockCache request parameters while allowing future call sites to pass 
structured context.
+ * </p>
+ */
[email protected]
+public final class CacheRequestContext {
+
+  private final boolean caching;
+  private final boolean repeat;
+  private final boolean updateCacheMetrics;
+  private final BlockType blockType;
+  private final boolean compaction;
+  private final boolean prefetch;
+
+  private CacheRequestContext(Builder builder) {
+    this.caching = builder.caching;
+    this.repeat = builder.repeat;
+    this.updateCacheMetrics = builder.updateCacheMetrics;
+    this.blockType = builder.blockType;
+    this.compaction = builder.compaction;
+    this.prefetch = builder.prefetch;
+  }
+
+  /**
+   * Creates a new builder.
+   */
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  /**
+   * Returns whether caching is enabled for this request.
+   * @return true when caching is enabled
+   */
+  public boolean isCaching() {
+    return caching;
+  }
+
+  /**
+   * Returns whether this is a repeated lookup for the same block.
+   * @return true when this is a repeated lookup
+   */
+  public boolean isRepeat() {
+    return repeat;
+  }

Review Comment:
   question:  how would this repeat be used ? is it something we will define in 
the each implementation that more than X times lookup would considered as 
repeat? 
   



-- 
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]

Reply via email to