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 GitHub
parent 121bdea230
commit d3c86f4f90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -486,7 +486,6 @@ public class BucketCache implements BlockCache, HeapSize {
} else {
this.blockNumber.increment();
this.heapSize.add(cachedItem.heapSize());
blocksByHFile.add(cacheKey);
}
}
@ -1027,6 +1026,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.