Repository: incubator-blur Updated Branches: refs/heads/master f320ffaff -> a5d62463f
Adding new import status to table stats command in shell. Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/a5d62463 Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/a5d62463 Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/a5d62463 Branch: refs/heads/master Commit: a5d62463fc3209f40c362f9eec277401c6f49d4f Parents: f320ffa Author: Aaron McCurry <[email protected]> Authored: Sat Mar 28 11:30:33 2015 -0400 Committer: Aaron McCurry <[email protected]> Committed: Sat Mar 28 11:30:33 2015 -0400 ---------------------------------------------------------------------- .../org/apache/blur/shell/TableStatsCommand.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a5d62463/blur-shell/src/main/java/org/apache/blur/shell/TableStatsCommand.java ---------------------------------------------------------------------- diff --git a/blur-shell/src/main/java/org/apache/blur/shell/TableStatsCommand.java b/blur-shell/src/main/java/org/apache/blur/shell/TableStatsCommand.java index b969337..29d9fc8 100644 --- a/blur-shell/src/main/java/org/apache/blur/shell/TableStatsCommand.java +++ b/blur-shell/src/main/java/org/apache/blur/shell/TableStatsCommand.java @@ -19,6 +19,7 @@ package org.apache.blur.shell; import java.io.PrintWriter; +import java.text.NumberFormat; import org.apache.blur.thirdparty.thrift_0_9_0.TException; import org.apache.blur.thrift.generated.Blur; @@ -42,14 +43,20 @@ public class TableStatsCommand extends Command implements TableFirstArgCommand { TableStats tableStats = client.tableStats(tablename); long bytes = tableStats.getBytes(); -// long queries = tableStats.getQueries(); long recordCount = tableStats.getRecordCount(); long rowCount = tableStats.getRowCount(); - //Queries is an unknown value now. -// out.println("Queries : " + queries); - out.println("Row Count : " + rowCount); - out.println("Record Count : " + recordCount); - out.println("Table Size : " + humanize(bytes)); + long segmentImportInProgressCount = tableStats.getSegmentImportInProgressCount(); + long segmentImportPendingCount = tableStats.getSegmentImportPendingCount(); + // Queries is an unknown value now. + out.println("Row Count : " + numberFormat(rowCount)); + out.println("Record Count : " + numberFormat(recordCount)); + out.println("Table Size : " + humanize(bytes)); + out.println("Pending Imports : " + segmentImportPendingCount); + out.println("In Progress Imports : " + segmentImportInProgressCount); + } + + private String numberFormat(long l) { + return NumberFormat.getNumberInstance().format(l); } private String humanize(long bytes) {
