@@ -611,6 +611,17 @@ private static void updateInfo(
611611 InetAddress nativeAddress = row .getInet ("native_address" );
612612 int nativePort = row .getInt ("native_port" );
613613 broadcastRpcAddress = new InetSocketAddress (nativeAddress , nativePort );
614+ } else if (row .getColumnDefinitions ().contains ("native_transport_address" )) {
615+ // DSE 6.8 introduced native_transport_address and native_transport_port for the
616+ // listen address. Also included is native_transport_port_ssl (in case users
617+ // want to setup a different port for SSL and non-SSL conns).
618+ InetAddress nativeAddress = row .getInet ("native_transport_address" );
619+ int nativePort = row .getInt ("native_transport_port" );
620+ if (cluster .getCluster ().getConfiguration ().getProtocolOptions ().getSSLOptions () != null
621+ && !row .isNull ("native_transport_port_ssl" )) {
622+ nativePort = row .getInt ("native_transport_port_ssl" );
623+ }
624+ broadcastRpcAddress = new InetSocketAddress (nativeAddress , nativePort );
614625 } else if (row .getColumnDefinitions ().contains ("rpc_address" )) {
615626 InetAddress rpcAddress = row .getInet ("rpc_address" );
616627 broadcastRpcAddress = new InetSocketAddress (rpcAddress , cluster .connectionFactory .getPort ());
@@ -831,6 +842,14 @@ private void refreshNodeListAndTokenMap(
831842 InetAddress nativeAddress = row .getInet ("native_address" );
832843 int nativePort = row .getInt ("native_port" );
833844 broadcastRpcAddress = new InetSocketAddress (nativeAddress , nativePort );
845+ } else if (row .getColumnDefinitions ().contains ("native_transport_address" )) {
846+ InetAddress nativeAddress = row .getInet ("native_transport_address" );
847+ int nativePort = row .getInt ("native_transport_port" );
848+ if (cluster .getCluster ().getConfiguration ().getProtocolOptions ().getSSLOptions () != null
849+ && !row .isNull ("native_transport_port_ssl" )) {
850+ nativePort = row .getInt ("native_transport_port_ssl" );
851+ }
852+ broadcastRpcAddress = new InetSocketAddress (nativeAddress , nativePort );
834853 } else {
835854 InetAddress rpcAddress = row .getInet ("rpc_address" );
836855 broadcastRpcAddress =
@@ -956,7 +975,11 @@ private boolean isValidPeer(Row peerRow, boolean logIfInvalid) {
956975 && !peerRow .isNull ("native_port" );
957976 } else {
958977 isValid &=
959- peerRow .getColumnDefinitions ().contains ("rpc_address" ) && !peerRow .isNull ("rpc_address" );
978+ (peerRow .getColumnDefinitions ().contains ("rpc_address" ) && !peerRow .isNull ("rpc_address" ))
979+ || (peerRow .getColumnDefinitions ().contains ("native_transport_address" )
980+ && peerRow .getColumnDefinitions ().contains ("native_transport_port" )
981+ && !peerRow .isNull ("native_transport_address" )
982+ && !peerRow .isNull ("native_transport_port" ));
960983 }
961984
962985 if (EXTENDED_PEER_CHECK ) {
@@ -984,6 +1007,9 @@ private String formatInvalidPeer(Row peerRow) {
9841007 formatMissingOrNullColumn (peerRow , "native_address" , sb );
9851008 formatMissingOrNullColumn (peerRow , "native_port" , sb );
9861009 } else {
1010+ formatMissingOrNullColumn (peerRow , "native_transport_address" , sb );
1011+ formatMissingOrNullColumn (peerRow , "native_transport_port" , sb );
1012+ formatMissingOrNullColumn (peerRow , "native_transport_port_ssl" , sb );
9871013 formatMissingOrNullColumn (peerRow , "rpc_address" , sb );
9881014 }
9891015 if (EXTENDED_PEER_CHECK ) {
0 commit comments