wchevreuil commented on code in PR #5808:
URL: https://github.com/apache/hbase/pull/5808#discussion_r1562274788


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePreadReader.java:
##########
@@ -37,6 +38,17 @@ public class HFilePreadReader extends HFileReaderImpl {
   public HFilePreadReader(ReaderContext context, HFileInfo fileInfo, 
CacheConfig cacheConf,
     Configuration conf) throws IOException {
     super(context, fileInfo, cacheConf, conf);
+
+    try {
+      DataTieringManager dataTieringManager = DataTieringManager.getInstance();
+      if (!dataTieringManager.isHotData(this)) {
+        LOG.debug("Data tiering is enabled for path '{}' and it is not hot 
data", path);
+        return;
+      }
+    } catch (IllegalStateException e) {
+      LOG.error("Error while getting DataTieringManager instance: {}", 
e.getMessage());

Review Comment:
   Please move this to BucketCache.shouldCacheFile implementation. Any caching 
related logic should be in the Cache related classes. Reader should only defer 
the decisions about caching to the Cache implementations.



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