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


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java:
##########
@@ -2490,7 +2490,16 @@ public Optional<Boolean> shouldCacheFile(HFileInfo 
hFileInfo, Configuration conf
     String fileName = hFileInfo.getHFileContext().getHFileName();
     DataTieringManager dataTieringManager = DataTieringManager.getInstance();
     if (dataTieringManager != null && !dataTieringManager.isHotData(hFileInfo, 
conf)) {
-      LOG.debug("Data tiering is enabled for file: '{}' and it is not hot 
data", fileName);
+      LOG.debug("Custom tiering is enabled for file: '{}' and it is not hot 
data", fileName);
+      // If custom tiering has been just enabled for a file that was cached, 
we now need
+      // to evict it.
+      Set<BlockCacheKey> keySet =
+        getAllCacheKeysForFile(hFileInfo.getHFileContext().getHFileName(), 0, 
Long.MAX_VALUE);
+      int evictedBlocks = evictBlockSet(keySet);
+      if (evictedBlocks > 0) {
+        LOG.info("Evicted {} blocks for file {} as it is now considered cold 
by DataTieringManager",

Review Comment:
   Maybe, yeah. Although it would be triggered only upon enabling of the time 
based priority on the individual store, and once for each affected file, it can 
still flood the logs. Let me switch it to DEBUG. 



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