java/openmldb-taskmanager/src/main/java/com/_4paradigm/openmldb/taskmanager/zk/FailoverWatcher.java
public void waitToInitZooKeeper(long maxWaitMillis) throws Exception {
    long finished = System.currentTimeMillis() + maxWaitMillis;
    while (System.currentTimeMillis() < finished) {
      if (this.zooKeeper != null) {
        return;
      }
      
      try {
        Thread.sleep(1);
      } catch (InterruptedException e) {
        throw new Exception(e);
      }
    }
    throw new Exception();
  }
/**
   * Wait to init ZooKeeper object, only sleep when it's null.
   *
   * @param maxWaitMillis the max sleep time
   * @throws Exception if ZooKeeper object is still null
   */
Wait to init ZooKeeper object, only sleep when it's null.
@param maxWaitMillis the max sleep time
@throws Exception if ZooKeeper object is still null
Wait to init ZooKeeper object only sleep when it ' s null . @param maxWaitMillis the max sleep time @throws Exception if ZooKeeper object is still null
public void waitToInitZooKeeper(long maxWaitMillis) throws Exception {
    long finished = System.currentTimeMillis() + maxWaitMillis;
    while (System.currentTimeMillis() < finished) {
      if (this.zooKeeper != null) {
        return;
      }
      try {
        Thread.sleep(1);
      } catch (InterruptedException e) {
        throw new Exception(e);
      }
    }
    throw new Exception();
  }
public void waitToInitZooKeeper ( long maxWaitMillis ) throws Exception { long finished = System . currentTimeMillis ( ) + maxWaitMillis ; while ( System . currentTimeMillis ( ) < finished ) { if ( this . zooKeeper != null ) { return ; } try { Thread . sleep ( 1 ) ; } catch ( InterruptedException e ) { throw new Exception ( e ) ; } } throw new Exception ( ) ; }
Wait to init ZooKeeper object, only sleep when it's null.
Wait to init ZooKeeper object only sleep when it ' s null .