/**
  * Waits indefinitely for availability of <code>.META.</code>. Used during cluster startup. Does
  * not verify meta, just that something has been set up in zk.
  *
  * @see #waitForMeta(long)
  * @throws InterruptedException if interrupted while waiting
  */
 public void waitForMeta() throws InterruptedException {
   while (!this.stopped) {
     try {
       if (waitForMeta(100) != null) break;
     } catch (NotAllMetaRegionsOnlineException e) {
       if (LOG.isTraceEnabled()) {
         LOG.info(
             ".META. still not available, sleeping and retrying." + " Reason: " + e.getMessage());
       }
     } catch (IOException e) {
       LOG.info("Retrying", e);
     }
   }
 }
Example #2
0
 /**
  * Waits indefinitely for availability of <code>hbase:meta</code>. Used during cluster startup.
  * Does not verify meta, just that something has been set up in zk.
  *
  * @see #waitMetaRegionLocation(org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher, long)
  * @throws InterruptedException if interrupted while waiting
  */
 public void waitMetaRegionLocation(ZooKeeperWatcher zkw) throws InterruptedException {
   long startTime = System.currentTimeMillis();
   while (!stopped) {
     try {
       if (waitMetaRegionLocation(zkw, 100) != null) break;
       long sleepTime = System.currentTimeMillis() - startTime;
       // +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."
                 + " Reason: "
                 + e.getMessage());
       }
     }
   }
 }