java/openmldb-taskmanager/src/main/java/com/_4paradigm/openmldb/taskmanager/zk/FailoverWatcher.java
protected void connectZooKeeper() throws IOException {
    LOG.info("Connecting ZooKeeper " + zkQuorum);

    for (int i = 0; i <= connectRetryTimes; i++) {
      try {
        zooKeeper = new ZooKeeper(zkQuorum, sessionTimeout, this);
        break;
      } catch (IOException e) {
        if (i == connectRetryTimes) {
          throw new IOException("Can't connect ZooKeeper after retrying", e);
        }
        LOG.error("Exception to connect ZooKeeper, retry " + (i + 1) + " times");
      }
    }
  }
/**
   * Connect with ZooKeeper with retries.
   *
   * @throws IOException when error to construct ZooKeeper object after retrying
   */
Connect with ZooKeeper with retries.
@throws IOException when error to construct ZooKeeper object after retrying
Connect with ZooKeeper with retries . @throws IOException when error to construct ZooKeeper object after retrying
protected void connectZooKeeper() throws IOException {
    LOG.info("Connecting ZooKeeper " + zkQuorum);
    for (int i = 0; i <= connectRetryTimes; i++) {
      try {
        zooKeeper = new ZooKeeper(zkQuorum, sessionTimeout, this);
        break;
      } catch (IOException e) {
        if (i == connectRetryTimes) {
          throw new IOException("Can't connect ZooKeeper after retrying", e);
        }
        LOG.error("Exception to connect ZooKeeper, retry " + (i + 1) + " times");
      }
    }
  }
protected void connectZooKeeper ( ) throws IOException { LOG . info ( "Connecting ZooKeeper " + zkQuorum ) ; for ( int i = 0 ; i <= connectRetryTimes ; i ++ ) { try { zooKeeper = new ZooKeeper ( zkQuorum , sessionTimeout , this ) ; break ; } catch ( IOException e ) { if ( i == connectRetryTimes ) { throw new IOException ( "Can't connect ZooKeeper after retrying" , e ) ; } LOG . error ( "Exception to connect ZooKeeper, retry " + ( i + 1 ) + " times" ) ; } } }
Connect with ZooKeeper with retries.
Connect with ZooKeeper with retries .