You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by bh...@apache.org on 2020/05/26 20:38:17 UTC
[hbase] branch branch-1 updated: HBASE-24423 No need to get lock in
canSplit because hasReferences will get lock too
This is an automated email from the ASF dual-hosted git repository.
bharathv 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 9f12ef0 HBASE-24423 No need to get lock in canSplit because hasReferences will get lock too
9f12ef0 is described below
commit 9f12ef07723c16fa4c9189847d035004beb40b70
Author: Zheng Wang <18...@qq.com>
AuthorDate: Sun May 24 20:10:17 2020 +0800
HBASE-24423 No need to get lock in canSplit because hasReferences will get lock too
Signed-off-by: Bharath Vissapragada <bh...@apache.org>
---
.../java/org/apache/hadoop/hbase/regionserver/HStore.java | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
index 5e86c88..eb2cd60 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
@@ -2160,17 +2160,12 @@ public class HStore implements Store {
@Override
public boolean canSplit() {
- this.lock.readLock().lock();
- try {
- // Not split-able if we find a reference store file present in the store.
- boolean result = !hasReferences();
- if (!result && LOG.isDebugEnabled()) {
- LOG.debug("Cannot split region due to reference files being there");
- }
- return result;
- } finally {
- this.lock.readLock().unlock();
+ // Not split-able if we find a reference store file present in the store.
+ boolean result = !hasReferences();
+ if (!result && LOG.isTraceEnabled()) {
+ LOG.trace(String.format("Not splittable; has references: %s", this));
}
+ return result;
}
@Override