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 05:52:55 UTC

[hbase] branch master 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 master
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/master by this push:
     new 29c59c0  HBASE-24423 No need to get lock in canSplit because hasReferences will get lock too
29c59c0 is described below

commit 29c59c0ba82e1c70b00886f916a995d323887ef6
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
---
 .../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 d5d8d43..eee6118 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
@@ -2061,17 +2061,12 @@ public class HStore implements Store, HeapSize, StoreConfigInformation,
 
   @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.trace("Not splittable; has references: {}", this);
-      }
-      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.trace("Not splittable; has references: {}", this);
     }
+    return result;
   }
 
   /**