smiklosovic commented on code in PR #3750:
URL: https://github.com/apache/cassandra/pull/3750#discussion_r1890702552


##########
src/java/org/apache/cassandra/tools/nodetool/ListSnapshots.java:
##########
@@ -81,18 +82,20 @@ public void execute(NodeProbe probe)
                 {
                     final List<?> value = (List<?>) eachValue;
                     if (includeEphemeral)
-                        table.add(value.toArray(new String[value.size()]));
-                    else
                         table.add(value.subList(0, value.size() - 
1).toArray(new String[value.size() - 1]));
+                    else
+                        table.add(value.subList(0, value.size() - 
2).toArray(new String[value.size() - 2]));
+
+                    totalTrueDiskSize += (Long) value.get(value.size() - 1);
                 }
             }
             table.printTo(out);
 
-            out.println("\nTotal TrueDiskSpaceUsed: " + 
FileUtils.stringifyFileSize(trueSnapshotsSize) + '\n');
+            out.println("\nTotal TrueDiskSpaceUsed: " + 
FileUtils.stringifyFileSize(totalTrueDiskSize) + '\n');

Review Comment:
   What exactly is breaking here? We literally just sum up numbers instead of 
calling jmx returning that number. It is same figure, we just sum it up from 
individual snapshots instead of calling jmx for the second time.



-- 
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]

Reply via email to