smiklosovic commented on code in PR #3733:
URL: https://github.com/apache/cassandra/pull/3733#discussion_r1883626804
##########
src/java/org/apache/cassandra/tools/nodetool/Status.java:
##########
@@ -170,24 +215,134 @@ private void addNode(String endpoint, Float owns,
HostStatWithPort hostStat, int
strOwns = owns != null && hasEffectiveOwns ? new
DecimalFormat("##0.0%").format(owns) : "?";
hostID = hostIDMap.get(endpoint);
- try
- {
+ try {
rack = epSnitchInfo.getRack(endpoint);
- }
- catch (UnknownHostException e)
- {
+ } catch (UnknownHostException e) {
throw new RuntimeException(e);
}
- epDns = hostStat.ipOrDns(printPort);
if (isTokenPerNode)
- {
- tableBuilder.add(statusAndState, epDns, load, strOwns, hostID,
hostStat.token, rack);
- }
+ return List.of(addressAndPort, statusAndState, epDns, load,
strOwns, hostID, hostStat.token, rack);
else
- {
- tableBuilder.add(statusAndState, epDns, load,
String.valueOf(size), strOwns, hostID, rack);
+ return List.of(addressAndPort, statusAndState, epDns, load,
String.valueOf(size), strOwns, hostID, rack);
+ }
+
+ // To check for descending order
+ private Boolean desc() {
Review Comment:
lease be sure that opening braces are on the new line. We have a codestyle
like that across the project we try to keep consistent everywhere.
https://cassandra.apache.org/_/development/code_style.html
See "Formatting" section.
##########
src/java/org/apache/cassandra/tools/nodetool/Status.java:
##########
@@ -170,24 +215,134 @@ private void addNode(String endpoint, Float owns,
HostStatWithPort hostStat, int
strOwns = owns != null && hasEffectiveOwns ? new
DecimalFormat("##0.0%").format(owns) : "?";
hostID = hostIDMap.get(endpoint);
- try
- {
+ try {
rack = epSnitchInfo.getRack(endpoint);
- }
- catch (UnknownHostException e)
- {
+ } catch (UnknownHostException e) {
throw new RuntimeException(e);
}
- epDns = hostStat.ipOrDns(printPort);
if (isTokenPerNode)
- {
- tableBuilder.add(statusAndState, epDns, load, strOwns, hostID,
hostStat.token, rack);
- }
+ return List.of(addressAndPort, statusAndState, epDns, load,
strOwns, hostID, hostStat.token, rack);
else
- {
- tableBuilder.add(statusAndState, epDns, load,
String.valueOf(size), strOwns, hostID, rack);
+ return List.of(addressAndPort, statusAndState, epDns, load,
String.valueOf(size), strOwns, hostID, rack);
+ }
+
+ // To check for descending order
+ private Boolean desc() {
Review Comment:
please be sure that opening braces are on the new line. We have a codestyle
like that across the project we try to keep consistent everywhere.
https://cassandra.apache.org/_/development/code_style.html
See "Formatting" section.
--
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]