hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ecl...@apache.org
Subject hbase git commit: HBASE-14555 Fix Deadlock in MVCC branch-1.2 toString()
Date Tue, 06 Oct 2015 00:50:06 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.2 c8a10f620 -> d5127a1f4


HBASE-14555 Fix Deadlock in MVCC branch-1.2 toString()


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/d5127a1f
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/d5127a1f
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/d5127a1f

Branch: refs/heads/branch-1.2
Commit: d5127a1f4089c131d564aecd025c486a59cbf7f3
Parents: c8a10f6
Author: Elliott Clark <eclark@apache.org>
Authored: Mon Oct 5 17:20:54 2015 -0700
Committer: Elliott Clark <eclark@apache.org>
Committed: Mon Oct 5 17:49:58 2015 -0700

----------------------------------------------------------------------
 .../MultiVersionConcurrencyControl.java         | 25 ++++++++------------
 1 file changed, 10 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/d5127a1f/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MultiVersionConcurrencyControl.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MultiVersionConcurrencyControl.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MultiVersionConcurrencyControl.java
index 00f349e..eba99e0 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MultiVersionConcurrencyControl.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MultiVersionConcurrencyControl.java
@@ -23,10 +23,13 @@ import java.util.concurrent.atomic.AtomicLong;
 
 import com.google.common.annotations.VisibleForTesting;
 
+import com.google.common.base.Objects;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.ClassSize;
-import org.mortbay.log.Log;
+
 
 /**
  * Manages the read/write consistency. This provides an interface for readers to determine
what
@@ -35,6 +38,8 @@ import org.mortbay.log.Log;
  */
 @InterfaceAudience.Private
 public class MultiVersionConcurrencyControl {
+  private static final Log LOG = LogFactory.getLog(MultiVersionConcurrencyControl.class);
+
   final AtomicLong readPoint = new AtomicLong(0);
   final AtomicLong writePoint = new AtomicLong(0);
   private final Object readWaiters = new Object();
@@ -206,7 +211,7 @@ public class MultiVersionConcurrencyControl {
     synchronized (readWaiters) {
       while (readPoint.get() < e.getWriteNumber()) {
         if (count % 100 == 0 && count > 0) {
-          Log.warn("STUCK: " + this);
+          LOG.warn("STUCK: " + this);
         }
         count++;
         try {
@@ -225,19 +230,9 @@ public class MultiVersionConcurrencyControl {
 
   @VisibleForTesting
   public String toString() {
-    StringBuffer sb = new StringBuffer(256);
-    sb.append("readPoint=");
-    sb.append(this.readPoint.get());
-    sb.append(", writePoint=");
-    sb.append(this.writePoint);
-    synchronized (this.writeQueue) {
-      for (WriteEntry we: this.writeQueue) {
-        sb.append(", [");
-        sb.append(we);
-        sb.append("]");
-      }
-    }
-    return sb.toString();
+    return Objects.toStringHelper(this)
+        .add("readPoint", readPoint)
+        .add("writePoint", writePoint).toString();
   }
 
   public long getReadPoint() {


Mime
View raw message