public void printState ( boolean connected ) { if ( ! quiet ) { StringBuilder sb = new StringBuilder ( ) ; if ( connected ) { sb . append ( localClusterName ) . append ( " <= " ) ; Iterator < Object > it = clustersProperties . keySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { String clusterName = ( String ) it . next ( ) ; if ( localClusterName . equals ( clusterName ) ) { continue ; } Long sentAt = region . get ( createSentAtKey ( clusterName ) ) ; Long receivedAt = region . get ( createReceivedAtKey ( clusterName , localClusterName ) ) ; long duration = receivedAt - sentAt ; sb . append ( "[" ) . append ( clusterName ) . append ( ", " ) . append ( duration ) . append ( "ms]" ) ; } } else { sb . append ( "Connection process is not finished for " ) . append ( localClusterName ) ; } System . out . println ( sb . toString ( ) ) ; } }
Prints the current state of connections