5 commented on code in PR #198:
URL: https://github.com/apache/cassandra-sidecar/pull/198#discussion_r1984014570
##########
server/src/main/java/org/apache/cassandra/sidecar/utils/InstanceMetadataFetcher.java:
##########
@@ -97,13 +97,29 @@ public CassandraAdapterDelegate delegate(@NotNull String
host) throws NoSuchCass
}
/**
- * Iterate through the local instances and call the function on the first
available instance, i.e. no CassandraUnavailableException
- * or OperationUnavailableException is thrown for the operations
+ * Iterate through the local instances and run the {@link Consumer} on the
first available one,
+ * so no {@link CassandraUnavailableException} or {@link
OperationUnavailableException} is thrown for the operations
+ *
+ * @param consumer a {@link Consumer} that processes {@link
InstanceMetadata} and returns no result
+ * @throws CassandraUnavailableException if all local instances were
exhausted
+ */
+ public void runOnFirstAvailableInstance(Consumer<InstanceMetadata>
consumer) throws CassandraUnavailableException
+ {
+ callOnFirstAvailableInstance(metadata ->
+ {
+ consumer.accept(metadata);
+ return null;
+ });
+ }
Review Comment:
Removed the method, tests, stylistic changes.
--
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]