Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CASSANDRA-19335 Default nodetool tablestats to Human-Readable Output #3069

Open
wants to merge 7 commits into
base: trunk
Choose a base branch
from
10 changes: 5 additions & 5 deletions src/java/org/apache/cassandra/tools/nodetool/TableStats.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ public class TableStats extends NodeToolCmd
@Option(name = "-i", description = "Ignore the list of tables and display the remaining tables")
private boolean ignore = false;

@Option(title = "human_readable",
name = {"-H", "--human-readable"},
description = "Display bytes in human readable form, i.e. KiB, MiB, GiB, TiB")
private boolean humanReadable = false;
@Option(title = "no_human_readable",
name = {"--no-human-readable"},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we spare a short flag here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! How about -r (for Raw) or -nhr (for No Human Readable)? I'll add -r for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-r short flag added (stands for Raw). Is there anything else missing here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-r works for me, thanks!

description = "Disable displaying bytes in human readable form, i.e. KiB, MiB, GiB, TiB")
private boolean noHumanReadable = false;

@Option(title = "format",
name = {"-F", "--format"},
Expand Down Expand Up @@ -98,7 +98,7 @@ public void execute(NodeProbe probe)
throw new IllegalArgumentException("argument for top must be a positive integer.");
}

StatsHolder holder = new TableStatsHolder(probe, humanReadable, ignore, tableNames, sortKey, top, locationCheck);
StatsHolder holder = new TableStatsHolder(probe, !noHumanReadable, ignore, tableNames, sortKey, top, locationCheck);
// print out the keyspace and table statistics
StatsPrinter printer = TableStatsPrinter.from(outputFormat, !sortKey.isEmpty());
printer.print(holder, probe.output().out);
Expand Down