question: private String prepareConnectString ( List < ZooKeeperNode > zknodes ) { StringBuffer buf = new StringBuffer ( ) ; int count = 1 ; for ( ZooKeeperNode node : zknodes ) { buf . append ( node . getHostname ( ) ) ; buf . append ( ":" ) ; buf . append ( node . getPort ( ) ) ; if ( count != zknodes . size ( ) ) { buf . append ( "," ) ; } count ++ ; } return buf . toString ( ) ; }
target:  MeesageService exposes single address/port combination. But This transport expects ZooKeeper servers to be deployed as ensemble(group of servers for failure mgmt). So assumption is each ZooKeeper server port is in incremental order. Based on the no. of servers configured in ZooKeeperTransportConfig, port number would be increased and connections string will be formed. Ex. addr1:port1,addr2:port2,addr3:port3