public void waitForAllHostsToBeReady ( int expectedHosts ) { try { m_zk . create ( CoreZK . readyhosts_host , null , Ids . OPEN_ACL_UNSAFE , CreateMode . EPHEMERAL_SEQUENTIAL ) ; while ( true ) { ZKUtil . FutureWatcher fw = new ZKUtil . FutureWatcher ( ) ; int readyHosts = m_zk . getChildren ( CoreZK . readyhosts , fw ) . size ( ) ; if ( readyHosts == expectedHosts ) { break ; } fw . get ( ) ; } } catch ( KeeperException | InterruptedException e ) { org . voltdb . VoltDB . crashLocalVoltDB ( "Error waiting for hosts to be ready" , false , e ) ; } }
Block on this call until the number of ready hosts is equal to the number of expected hosts .