You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by re...@apache.org on 2021/11/22 10:46:45 UTC
[hbase] branch branch-1 updated: HBASE-26325 Backport the HBASE-26305 to branch-1. Move NavigableSet add operation to writer thread in BucketCache (#3776)
This is an automated email from the ASF dual-hosted git repository.
reidchan pushed a commit to branch branch-1
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-1 by this push:
new 1701f0d HBASE-26325 Backport the HBASE-26305 to branch-1. Move NavigableSet add operation to writer thread in BucketCache (#3776)
1701f0d is described below
commit 1701f0de0ace50130d607a8627aac4fa1445095a
Author: Yutong Xiao <yu...@gmail.com>
AuthorDate: Mon Nov 22 18:46:10 2021 +0800
HBASE-26325 Backport the HBASE-26305 to branch-1. Move NavigableSet add operation to writer thread in BucketCache (#3776)
Signed-off-by: Reid Chan <re...@apache.org>
---
.../java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java
index f11ba26..93440c8 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java
@@ -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.