yifan-c commented on code in PR #45:
URL: https://github.com/apache/cassandra-sidecar/pull/45#discussion_r1194431202
##########
common/src/main/java/org/apache/cassandra/sidecar/common/CassandraAdapterDelegate.java:
##########
@@ -145,47 +124,73 @@ private void healthCheckInternal()
Row oneResult = activeSession.execute("select release_version,
partitioner from system.local")
.one();
- String releaseVersion = oneResult.getString("release_version");
- // update the nodeSettings cache.
// Note that within the scope of this method, we should keep on
using the local releaseVersion
- nodeSettings = new NodeSettings(releaseVersion,
oneResult.getString("partitioner"));
- // this might swap the adapter out
- SimpleCassandraVersion newVersion =
SimpleCassandraVersion.create(releaseVersion);
- if (!newVersion.equals(currentVersion))
+ String releaseVersion = oneResult.getString("release_version");
+ NodeSettings newNodeSettings = new NodeSettings(releaseVersion,
oneResult.getString("partitioner"));
+ if (!newNodeSettings.equals(nodeSettings))
{
- currentVersion = newVersion;
- adapter =
versionProvider.getCassandra(nodeSettings.releaseVersion()).create(cqlSession,
jmxClient);
- logger.info("Cassandra version change detected. New adapter
loaded: {}", adapter);
+ // update the nodeSettings cache.
+ SimpleCassandraVersion previousVersion = currentVersion;
+ currentVersion = SimpleCassandraVersion.create(releaseVersion);
+ adapter = versionProvider.cassandra(releaseVersion)
+ .create(cqlSessionProvider,
jmxClient);
+ nodeSettings = newNodeSettings;
Review Comment:
yep
--
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]