JeetKunDoug commented on code in PR #74:
URL: https://github.com/apache/cassandra-sidecar/pull/74#discussion_r1414715323
##########
src/main/java/org/apache/cassandra/sidecar/cluster/CassandraAdapterDelegate.java:
##########
@@ -166,8 +177,18 @@ private void healthCheckInternal()
try
{
- Row oneResult = activeSession.execute("select release_version,
partitioner from system.local")
- .one();
+ // NOTE: We cannot use `executeLocal` here as there may be no
adapter yet.
+ SimpleStatement healthCheckStatement =
+ new SimpleStatement("select release_version, partitioner from
system.local");
+ Host host =
DriverExtensions.getHost(activeSession.getCluster().getMetadata(),
localNativeTransportAddress);
+ if (host == null)
+ {
+ LOGGER.warn("Could not find host in cluster metadata by
address and port {}",
+ localNativeTransportAddress);
+ return;
+ }
+ healthCheckStatement.setHost(host);
Review Comment:
Good catch!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]