wchevreuil commented on code in PR #5829:
URL: https://github.com/apache/hbase/pull/5829#discussion_r1572237627
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java:
##########
@@ -983,6 +994,15 @@ void freeSpace(final String why) {
// Scan entire map putting bucket entry into appropriate bucket entry
// group
for (Map.Entry<BlockCacheKey, BucketEntry> bucketEntryWithKey :
backingMap.entrySet()) {
+
+ if (coldFiles != null
+ &&
coldFiles.containsKey(bucketEntryWithKey.getKey().getHfileName())) {
+ int freedBlockSize = bucketEntryWithKey.getValue().getLength();
+ evictBlockIfNoRpcReferenced(bucketEntryWithKey.getKey());
Review Comment:
`evictBlockIfNoRpcReferenced` returns a boolean indicating whether the
eviction was successful or not. We should check that boolean in orther to
decide if we should increment `bytesFreed`.
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java:
##########
@@ -980,9 +991,18 @@ void freeSpace(final String why) {
BucketEntryGroup bucketMemory =
new BucketEntryGroup(bytesToFreeWithExtra, blockSize,
getPartitionSize(memoryFactor));
+ long bytesFreed = 0;
+
// Scan entire map putting bucket entry into appropriate bucket entry
// group
for (Map.Entry<BlockCacheKey, BucketEntry> bucketEntryWithKey :
backingMap.entrySet()) {
+
+ if (coldFiles.containsKey(bucketEntryWithKey.getKey().getHfileName()))
{
+ //coldBlocks.add(bucketEntryWithKey.getKey());
+ bytesFreed += bucketEntryWithKey.getValue().getLength();
+ evictBlock(bucketEntryWithKey.getKey());
Review Comment:
No, that not what I meant. You already have `bytesToFreeWithExtra`
calculated in line #983 and you are computing `bytesFreed`. Once `bytesFreed`
reached `bytesToFreeWithExtra` value, you still want to evict the cold files or
should we just interrupt the loop?
--
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]