HBASE-26305 Move NavigableSet add operation to writer thread in BucketCache (#3705)

Signed-off-by: Duo Zhang <zhangduo@apache.org>
Reviewed-by: chenglei <chenglei@apache.org>
This commit is contained in:
Yutong Xiao 2021-10-01 20:57:51 +08:00 committed by Duo Zhang
parent 0748165ab0
commit a2c09ae5bc
1 changed files with 5 additions and 1 deletions

View File

@ -475,7 +475,6 @@ public class BucketCache implements BlockCache, HeapSize {
} else {
this.blockNumber.increment();
this.heapSize.add(cachedItem.heapSize());
blocksByHFile.add(cacheKey);
}
}
@ -1016,6 +1015,11 @@ public class BucketCache implements BlockCache, HeapSize {
index++;
continue;
}
BlockCacheKey cacheKey = re.getKey();
if (ramCache.containsKey(cacheKey)) {
blocksByHFile.add(cacheKey);
}
BucketEntry bucketEntry = re.writeToCache(ioEngine, bucketAllocator, realCacheSize,
this::createRecycler);
// Successfully added. Up index and add bucketEntry. Clear io exceptions.