hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject svn commit: r1220859 - in /hbase/branches/0.90: CHANGES.txt src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java
Date Mon, 19 Dec 2011 17:21:21 GMT
Author: tedyu
Date: Mon Dec 19 17:21:20 2011
New Revision: 1220859

URL: http://svn.apache.org/viewvc?rev=1220859&view=rev
Log:
HBASE-5060  HBase client is blocked forever (Jinchao)

Modified:
    hbase/branches/0.90/CHANGES.txt
    hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java

Modified: hbase/branches/0.90/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/CHANGES.txt?rev=1220859&r1=1220858&r2=1220859&view=diff
==============================================================================
--- hbase/branches/0.90/CHANGES.txt (original)
+++ hbase/branches/0.90/CHANGES.txt Mon Dec 19 17:21:20 2011
@@ -7,6 +7,7 @@ Release 0.90.6 - Unreleased
                false in 0.90 version (Chunhui Shen)
    HBASE-4893  HConnectionImplementation is closed but not deleted (Mubarak)
    HBASE-4970  Add a parameter so that keepAliveTime of Htable thread pool can be changed
(gaojinchao)
+   HBASE-5060  HBase client is blocked forever (Jinchao)
 
 Release 0.90.5 - Unreleased
   BUG FIXES

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java?rev=1220859&r1=1220858&r2=1220859&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java
(original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java
Mon Dec 19 17:21:20 2011
@@ -75,6 +75,7 @@ public class CatalogTracker {
   private HServerAddress metaLocation;
   private final int defaultTimeout;
   private boolean stopped = false;
+  private HConnection abortable;
 
   public static final byte [] ROOT_REGION =
     HRegionInfo.ROOT_REGIONINFO.getRegionName();
@@ -134,10 +135,19 @@ public class CatalogTracker {
     this.connection = connection;
     this.zookeeper = (zk == null) ? this.connection.getZooKeeperWatcher() : zk;
     if (abortable == null) {
-      abortable = this.connection;
+      this.abortable = this.connection;
     }
-    this.rootRegionTracker = new RootRegionTracker(zookeeper, abortable);
-    this.metaNodeTracker = new MetaNodeTracker(zookeeper, this, abortable);
+    Abortable throwableAborter = new Abortable() {
+
+      @Override
+      public void abort(String why, Throwable e) {
+        throw new RuntimeException(why, e);
+      }
+      
+    };
+    
+    this.rootRegionTracker = new RootRegionTracker(zookeeper, throwableAborter);
+    this.metaNodeTracker = new MetaNodeTracker(zookeeper, this, throwableAborter);
     this.defaultTimeout = defaultTimeout;
   }
 
@@ -149,9 +159,16 @@ public class CatalogTracker {
    * @throws InterruptedException 
    */
   public void start() throws IOException, InterruptedException {
-    this.rootRegionTracker.start();
-    this.metaNodeTracker.start();
-    LOG.debug("Starting catalog tracker " + this);
+    
+    try {
+      this.rootRegionTracker.start();
+      this.metaNodeTracker.start();
+      LOG.debug("Starting catalog tracker " + this);
+    }catch (RuntimeException e){
+      Throwable t = e.getCause();
+      this.abortable.abort(e.getMessage(), t);
+      throw new IOException("Attempt to start root/meta tracker failed.", t);
+    }
   }
 
   /**



Mime
View raw message