smiklosovic commented on code in PR #4394:
URL: https://github.com/apache/cassandra/pull/4394#discussion_r2377834799
##########
src/java/org/apache/cassandra/gms/Gossiper.java:
##########
@@ -2070,6 +2071,74 @@ public void setLooseEmptyEnabled(boolean enabled)
EndpointState.LOOSE_DEF_OF_EMPTY_ENABLED = enabled;
}
+ @Override
+ public Map<String, Map<String, Object>> echoAllNodesWithTiming()
+ {
+ Map<String, Map<String, Object>> results = new HashMap<>();
+ Set<InetAddressAndPort> liveMembers = getLiveMembers();
+
+ for (InetAddressAndPort endpoint : liveMembers)
+ {
+ Map<String, Object> nodeResult = new HashMap<>();
+
+ // Skip self - no need to echo to ourselves
+ if (endpoint.equals(getBroadcastAddressAndPort()))
+ {
+ nodeResult.put("status", "SELF");
+ nodeResult.put("responseTimeMs", 0);
+ nodeResult.put("timestamp", System.currentTimeMillis());
+ results.put(endpoint.toString(), nodeResult);
+ continue;
+ }
+
+ long startTime = System.nanoTime();
+ long timestamp = System.currentTimeMillis();
+
+ try
+ {
+ // Create ECHO_REQ message with no payload
+ Message<NoPayload> echoMessage = Message.out(ECHO_REQ,
noPayload);
+
+ // Async response handling
+ CompletableFuture<String> future = new CompletableFuture<>();
+
+ RequestCallback echoHandler = msg -> {
Review Comment:
should not you implement `onFailure` of `RequestCallback` method? You have
`RequestFailure` available as a parameter of `onFailure` from which you can
decide if it was timeout or any other reason that message has failed. For now,
your "status" in case of "ERROR" is not granular enough.
--
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]