zaaath commented on code in PR #2977:
URL: https://github.com/apache/cassandra/pull/2977#discussion_r1430894538
##########
src/java/org/apache/cassandra/tools/nodetool/stats/TableStatsPrinter.java:
##########
@@ -167,6 +168,11 @@ protected void printStatsTable(StatsTable table, String
tableDisplayName, String
}
out.println("");
}
+
+ protected String formatMemory(long bytes, boolean humanReadable)
Review Comment:
@smiklosovic good point, I renamed it to `formatDataSize` and made it
private.
Regarding `out.printf(indent...`, it looks weird and convoluted, but it
actually makes sense. `maxWidth` sets the width of the "Key" column with left
alignment which is what `%-{maxWidth}` is for. For example, let's assume that
`index = ""` (empty) and `maxWidth = 10`, then the line becomes:
`out.printf(" %-10s %s%n", "Key", "Size");`
which prints:
` Key Size`
where the distance between "K" and "S" is `maxWidth+1=10+1=11` characters.
--
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]