Repository: cassandra
Updated Branches:
  refs/heads/trunk 0494cf75c -> c3d10abc7


don't call getCompactions thru the proxy twice for compactionstats


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

Branch: refs/heads/trunk
Commit: db3cc3e65163dbb6ef0f75a158f632d168e314d9
Parents: 2c28fde
Author: Dave Brosius <dbros...@mebigfatguy.com>
Authored: Sun Sep 14 22:01:27 2014 -0400
Committer: Dave Brosius <dbros...@mebigfatguy.com>
Committed: Sun Sep 14 22:01:27 2014 -0400

----------------------------------------------------------------------
 src/java/org/apache/cassandra/tools/NodeTool.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/db3cc3e6/src/java/org/apache/cassandra/tools/NodeTool.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/NodeTool.java 
b/src/java/org/apache/cassandra/tools/NodeTool.java
index 08a8055..fbdce0f 100644
--- a/src/java/org/apache/cassandra/tools/NodeTool.java
+++ b/src/java/org/apache/cassandra/tools/NodeTool.java
@@ -1175,13 +1175,14 @@ public class NodeTool
             CompactionManagerMBean cm = probe.getCompactionManagerProxy();
             System.out.println("pending tasks: " + 
probe.getCompactionMetric("PendingTasks"));
             long remainingBytes = 0;
-            if (cm.getCompactions().size() > 0)
+            List<Map<String, String>> compactions = cm.getCompactions();
+            if (!compactions.isEmpty())
             {
                 List<String[]> lines = new ArrayList<>();
                 int[] columnSizes = new int[] { 0, 0, 0, 0, 0, 0, 0 };
 
                 addLine(lines, columnSizes, "compaction type", "keyspace", 
"table", "completed", "total", "unit", "progress");
-                for (Map<String, String> c : cm.getCompactions())
+                for (Map<String, String> c : compactions)
                 {
                     long total = Long.parseLong(c.get("total"));
                     long completed = Long.parseLong(c.get("completed"));

Reply via email to