krummas commented on code in PR #4036: URL: https://github.com/apache/cassandra/pull/4036#discussion_r2030779344
########## src/java/org/apache/cassandra/tools/nodetool/Status.java: ########## @@ -98,6 +105,7 @@ public void execute(NodeProbe probe) unreachableNodes = probe.getUnreachableNodes(true); hostIDMap = probe.getHostIdMap(true); epSnitchInfo = probe.getEndpointSnitchInfoProxy(); + cmsProxy = hasCms ? probe.getCMSOperationsProxy() : null; Review Comment: same as above - maybe just grab which nodes are actually in the CMS here and use that set when outputting below instead of querying for each node? ########## src/java/org/apache/cassandra/tcm/CMSOperationsMBean.java: ########## @@ -33,6 +35,7 @@ public interface CMSOperationsMBean public void cancelReconfigureCms(); public Map<String, String> describeCMS(); + public boolean isCurrentMember(InetAddressAndPort peer); Review Comment: we can't have InetAddressAndPort here since we expose this over JMX - we need to translate between strings ########## src/java/org/apache/cassandra/tools/nodetool/Ring.java: ########## @@ -177,8 +184,39 @@ else if (movingNodes.contains(endpoint)) String load = loadMap.getOrDefault(endpoint, "?"); String owns = stat.owns != null && showEffectiveOwnership? new DecimalFormat("##0.00%").format(stat.owns) : "?"; - out.printf(format, stat.ipOrDns(printPort), rack, status, state, load, owns, stat.token); + List<Object> result = Lists.newArrayList(stat.ipOrDns(printPort), rack, status, state, load, owns, stat.token); + if (hasCms) + result.add(String.valueOf(cmsProxy.isCurrentMember(stat.endpointWithPort))); Review Comment: I think instead of calling this for every node in the ring, we could have a `Set<String> cms = cmsProxy.getCurrentCMS()` outside the loop and just check that Also, would it make sense to output `CMS` on the cms nodes? To make it easier to `nodetool ring --cms | grep CMS` (I don't think we currently output anything else containing true/false, but we could in the future) -- 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: pr-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For additional commands, e-mail: pr-h...@cassandra.apache.org