Package org.apache.hadoop.hdfs.server.namenode.bookkeeper.zk

Examples of org.apache.hadoop.hdfs.server.namenode.bookkeeper.zk.ConnectionWatcher


    int zkMaxRetries = conf.getInt(BKJM_ZK_MAX_RETRIES,
       BKJM_ZK_MAX_RETRIES_DEFAULT);
    int zkRetryIntervalMs = conf.getInt(BKJM_ZK_RETRY_INTERVAL,
        BKJM_ZK_RETRY_INTERVAL_DEFAULT);
    CountDownLatch connectLatch = new CountDownLatch(1);
    ConnectionWatcher connectionWatcher = new ConnectionWatcher(connectLatch);
    ZooKeeper zooKeeper = new ZooKeeper(zkConnect, zkSessionTimeoutMs,
        connectionWatcher);
    // Use twice session timeout as the connection timeout
    int zkConnectTimeoutMs = zkSessionTimeoutMs * 2;

    if (!connectionWatcher.await(zkConnectTimeoutMs)) {
      throw new IOException("Timed out waiting to connect to " + zkConnect
          + " after " + (zkSessionTimeoutMs * 2) + " ms.");
    }
    prepareBookKeeperEnv(ledgersAvailablePath, zooKeeper);

View Full Code Here

TOP

Related Classes of org.apache.hadoop.hdfs.server.namenode.bookkeeper.zk.ConnectionWatcher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.