Author: jdcryans
Date: Mon Apr 14 19:00:48 2014
New Revision: 1587283

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

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

Modified: 
hbase/branches/0.98/hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java
URL: 
http://svn.apache.org/viewvc/hbase/branches/0.98/hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java?rev=1587283&r1=1587282&r2=1587283&view=diff
==============================================================================
--- 
hbase/branches/0.98/hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java
 (original)
+++ 
hbase/branches/0.98/hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java
 Mon Apr 14 19:00:48 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." +


Reply via email to