You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by jd...@apache.org on 2014/04/14 20:54:40 UTC

svn commit: r1587281 - /hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java

Author: jdcryans
Date: Mon Apr 14 18:54:39 2014
New Revision: 1587281

URL: http://svn.apache.org/r1587281
Log:
HBASE-10967 CatalogTracker.waitForMeta should not wait indefinitely silently

Modified:
    hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java

Modified: hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java?rev=1587281&r1=1587280&r2=1587281&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java (original)
+++ hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java Mon Apr 14 18:54:39 2014
@@ -17,6 +17,7 @@
  */
 package org.apache.hadoop.hbase.catalog;
 
+import com.google.common.base.Stopwatch;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.classification.InterfaceAudience;
@@ -303,9 +304,15 @@ public class CatalogTracker {
    * @throws InterruptedException if interrupted while waiting
    */
   public void waitForMeta() throws InterruptedException {
+    Stopwatch stopwatch = new Stopwatch().start();
     while (!this.stopped) {
       try {
         if (waitForMeta(100) != null) break;
+        long sleepTime = stopwatch.elapsedMillis();
+        // +1 in case sleepTime=0
+        if ((sleepTime + 1) % 10000 == 0) {
+          LOG.warn("Have been waiting for meta to be assigned for " + sleepTime + "ms");
+        }
       } catch (NotAllMetaRegionsOnlineException e) {
         if (LOG.isTraceEnabled()) {
           LOG.trace("hbase:meta still not available, sleeping and retrying." +