cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject [01/10] cassandra git commit: Avoid showing estimated key as -1 in tablestats
Date Tue, 31 May 2016 22:08:03 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.2 a5dac1298 -> 39b86e379
  refs/heads/cassandra-3.0 15ec93041 -> 4aaf2b34f
  refs/heads/cassandra-3.7 f40c632e4 -> f000ff08f
  refs/heads/trunk 61c988e51 -> f55d2d494


Avoid showing estimated key as -1 in tablestats

patch by Mahdi Mohammadi; reviewed by yukim for CASSANDRA-11587


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/39b86e37
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/39b86e37
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/39b86e37

Branch: refs/heads/cassandra-2.2
Commit: 39b86e3792721cfc8aeef639cfd4ac06c56288e8
Parents: a5dac12
Author: Mahdi Mohammadi <mm@binary.com>
Authored: Sat May 28 05:01:46 2016 +0800
Committer: Yuki Morishita <yukim@apache.org>
Committed: Tue May 31 16:08:35 2016 -0500

----------------------------------------------------------------------
 CHANGES.txt                                               |  1 +
 .../org/apache/cassandra/tools/nodetool/TableStats.java   | 10 +++++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/39b86e37/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 7215836..7c66125 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.2.7
+ * Avoid showing estimated key as -1 in tablestats (CASSANDRA-11587)
  * Fix possible race condition in CommitLog.recover (CASSANDRA-11743)
  * Enable client encryption in sstableloader with cli options (CASSANDRA-11708)
  * Possible memory leak in NIODataInputStream (CASSANDRA-11867)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/39b86e37/src/java/org/apache/cassandra/tools/nodetool/TableStats.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/nodetool/TableStats.java b/src/java/org/apache/cassandra/tools/nodetool/TableStats.java
index 8293960..a1d2038 100644
--- a/src/java/org/apache/cassandra/tools/nodetool/TableStats.java
+++ b/src/java/org/apache/cassandra/tools/nodetool/TableStats.java
@@ -185,7 +185,15 @@ public class TableStats extends NodeToolCmd
                 if (offHeapSize != null)
                     System.out.println("\t\tOff heap memory used (total): " + format(offHeapSize,
humanReadable));
                 System.out.println("\t\tSSTable Compression Ratio: " + probe.getColumnFamilyMetric(keyspaceName,
tableName, "CompressionRatio"));
-                System.out.println("\t\tNumber of keys (estimate): " + probe.getColumnFamilyMetric(keyspaceName,
tableName, "EstimatedRowCount"));
+
+                Object estimatedRowCount = probe.getColumnFamilyMetric(keyspaceName, tableName,
"EstimatedRowCount");
+                if (Long.valueOf(-1L).equals(estimatedRowCount))
+                {
+                    estimatedRowCount = 0L;
+                }
+
+                System.out.println("\t\tNumber of keys (estimate): " + estimatedRowCount);
+
                 System.out.println("\t\tMemtable cell count: " + probe.getColumnFamilyMetric(keyspaceName,
tableName, "MemtableColumnsCount"));
                 System.out.println("\t\tMemtable data size: " + format((Long) probe.getColumnFamilyMetric(keyspaceName,
tableName, "MemtableLiveDataSize"), humanReadable));
                 if (memtableOffHeapSize != null)


Mime
View raw message