@@ -120,7 +120,7 @@ public CompletionStage<Optional<NodeInfo>> refreshNode(Node node) {
120120 query (
121121 channel ,
122122 "SELECT * FROM "
123- + retrievePeerTableName ()
123+ + getPeerTableName ()
124124 + " WHERE peer = :address and peer_port = :port" ,
125125 ImmutableMap .of (
126126 "address" ,
@@ -131,12 +131,12 @@ public CompletionStage<Optional<NodeInfo>> refreshNode(Node node) {
131131 query =
132132 query (
133133 channel ,
134- "SELECT * FROM " + retrievePeerTableName () + " WHERE peer = :address" ,
134+ "SELECT * FROM " + getPeerTableName () + " WHERE peer = :address" ,
135135 ImmutableMap .of ("address" , node .getBroadcastAddress ().get ().getAddress ()));
136136 }
137137 return query .thenApply (result -> firstPeerRowAsNodeInfo (result , localEndPoint ));
138138 } else {
139- return query (channel , "SELECT * FROM " + retrievePeerTableName ())
139+ return query (channel , "SELECT * FROM " + getPeerTableName ())
140140 .thenApply (result -> findInPeers (result , node .getHostId (), localEndPoint ));
141141 }
142142 }
@@ -149,7 +149,7 @@ public CompletionStage<Optional<NodeInfo>> getNewNodeInfo(InetSocketAddress broa
149149 LOG .debug ("[{}] Fetching info for new node {}" , logPrefix , broadcastRpcAddress );
150150 DriverChannel channel = controlConnection .channel ();
151151 EndPoint localEndPoint = channel .getEndPoint ();
152- return query (channel , "SELECT * FROM " + retrievePeerTableName ())
152+ return query (channel , "SELECT * FROM " + getPeerTableName ())
153153 .thenApply (result -> findInPeers (result , broadcastRpcAddress , localEndPoint ));
154154 }
155155
@@ -255,11 +255,8 @@ private CompletionStage<AdminResult> query(DriverChannel channel, String querySt
255255 return query (channel , queryString , Collections .emptyMap ());
256256 }
257257
258- private String retrievePeerTableName () {
259- if (isSchemaV2 ) {
260- return "system.peers_v2" ;
261- }
262- return "system.peers" ;
258+ private String getPeerTableName () {
259+ return isSchemaV2 ? "system.peers_v2" : "system.peers" ;
263260 }
264261
265262 private Optional <NodeInfo > firstPeerRowAsNodeInfo (AdminResult result , EndPoint localEndPoint ) {
@@ -459,7 +456,7 @@ protected InetSocketAddress getBroadcastRpcAddress(
459456 + "configuration in cassandra.yaml on all nodes in your cluster." ,
460457 logPrefix ,
461458 localEndPoint ,
462- retrievePeerTableName ());
459+ getPeerTableName ());
463460 return null ;
464461 }
465462
@@ -485,7 +482,7 @@ protected boolean isPeerValid(AdminRow peerRow) {
485482 "[{}] Found invalid row in {} for peer: {}. "
486483 + "This is likely a gossip or snitch issue, this node will be ignored." ,
487484 logPrefix ,
488- retrievePeerTableName (),
485+ getPeerTableName (),
489486 peerRow .getInetAddress ("peer" ));
490487 }
491488 return valid ;
0 commit comments