private void waitForConnected ( ) { debug ( "GuestNode#waitForConnected(): Waiting for all the clusters connected" ) ; while ( true ) { boolean connected = true ; for ( Object fromKey : clustersProperties . keySet ( ) ) { String fromClusterName = ( String ) fromKey ; for ( Object toKey : clustersProperties . keySet ( ) ) { String toClusterName = ( String ) toKey ; if ( fromClusterName . equals ( toClusterName ) ) { continue ; } Long receivedAt = region . get ( createReceivedAtKey ( fromClusterName , toClusterName ) ) ; if ( receivedAt == null ) { connected = false ; break ; } } } if ( connected ) { break ; } try { TimeUnit . MILLISECONDS . sleep ( CHECK_PERIOD ) ; } catch ( InterruptedException e ) { } } debug ( "GuestNode#waitForConnected(): All the clusters connected" ) ; }
Wait until all the clients received all the receivedAt entries .