HBASE-26325 Backport the HBASE-26305 to branch-1. Move NavigableSet add operation to writer thread in BucketCache (#3776)

Signed-off-by: Reid Chan <reidchan@apache.org>
This commit is contained in:
Yutong Xiao 2021-11-22 18:46:10 +08:00 committed by GitHub
parent 0d214ff53e
commit 1701f0de0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -467,7 +467,6 @@ public class BucketCache implements BlockCache, HeapSize {
} else {
this.blockNumber.incrementAndGet();
this.heapSize.addAndGet(cachedItem.heapSize());
blocksByHFile.add(cacheKey);
}
}
@ -921,6 +920,12 @@ 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, deserialiserMap, realCacheSize);
// Successfully added. Up index and add bucketEntry. Clear io exceptions.