public static List < HostAndPort > splitToHostsAndPorts ( String hostPortQuorumList ) { // split an address hot String [ ] strings = StringUtils . getStrings ( hostPortQuorumList ) ; int len = 0 ; if ( strings != null ) { len = strings . length ; } List < HostAndPort > list = new ArrayList < HostAndPort > ( len ) ; if ( strings != null ) { for ( String s : strings ) { list . add ( HostAndPort . fromString ( s . trim ( ) ) . withDefaultPort ( DEFAULT_PORT ) ) ; } } return list ; }
Split a quorum list into a list of hostnames and ports