public boolean await ( long timeoutMillis ) throws IOException { try { return connectLatch . await ( timeoutMillis , TimeUnit . MILLISECONDS ) ; } catch ( InterruptedException e ) { interruptedException ( "Interrupted waiting for connection (timeout = " + timeoutMillis + "ms.)" , e ) ; return false ; } }
Wait until either a specified timeout expires or a connection is created to ZooKeeper .