cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject [3/8] cassandra git commit: Fix undeclared throwable exception while executing 'nodetool netstats localhost'
Date Mon, 01 Dec 2014 18:23:46 GMT
Fix undeclared throwable exception while executing 'nodetool netstats localhost'

Patch by Vishal Mehta and Carl Yeksigian, reviewed by Carl Yeksigian for
CASSANDRA-8122


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

Branch: refs/heads/trunk
Commit: 54b4b99e1e12328005df51feb71448a320a9b7d6
Parents: 902e43b
Author: Brandon Williams <brandonwilliams@apache.org>
Authored: Mon Dec 1 12:18:54 2014 -0600
Committer: Brandon Williams <brandonwilliams@apache.org>
Committed: Mon Dec 1 12:18:54 2014 -0600

----------------------------------------------------------------------
 .../cassandra/service/StorageService.java       |  5 ++
 .../cassandra/service/StorageServiceMBean.java  |  3 ++
 .../org/apache/cassandra/tools/NodeCmd.java     | 55 +++++++++++---------
 .../org/apache/cassandra/tools/NodeProbe.java   |  5 ++
 4 files changed, 42 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/54b4b99e/src/java/org/apache/cassandra/service/StorageService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java
index 601e036..0456907 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -3387,6 +3387,11 @@ public class StorageService extends NotificationBroadcasterSupport
implements IE
         return operationMode.toString();
     }
 
+    public boolean isStarting()
+    {
+        return operationMode == Mode.STARTING;
+    }
+
     public String getDrainProgress()
     {
         return String.format("Drained %s/%s ColumnFamilies", remainingCFs, totalCFs);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/54b4b99e/src/java/org/apache/cassandra/service/StorageServiceMBean.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StorageServiceMBean.java b/src/java/org/apache/cassandra/service/StorageServiceMBean.java
index 2386fc8..0ea08a2 100644
--- a/src/java/org/apache/cassandra/service/StorageServiceMBean.java
+++ b/src/java/org/apache/cassandra/service/StorageServiceMBean.java
@@ -358,6 +358,9 @@ public interface StorageServiceMBean extends NotificationEmitter
     /** get the operational mode (leaving, joining, normal, decommissioned, client) **/
     public String getOperationMode();
 
+    /** Returns whether the storage service is starting or not */
+    public boolean isStarting();
+
     /** get the progress of a drain operation */
     public String getDrainProgress();
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/54b4b99e/src/java/org/apache/cassandra/tools/NodeCmd.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/NodeCmd.java b/src/java/org/apache/cassandra/tools/NodeCmd.java
index e4a14b2..b085088 100644
--- a/src/java/org/apache/cassandra/tools/NodeCmd.java
+++ b/src/java/org/apache/cassandra/tools/NodeCmd.java
@@ -762,32 +762,35 @@ public class NodeCmd
             }
         }
 
-        outs.printf("Read Repair Statistics:%nAttempted: %d%nMismatch (Blocking): %d%nMismatch
(Background): %d%n", probe.getReadRepairAttempted(), probe.getReadRepairRepairedBlocking(),
probe.getReadRepairRepairedBackground());
-
-        MessagingServiceMBean ms = probe.msProxy;
-        outs.printf("%-25s", "Pool Name");
-        outs.printf("%10s", "Active");
-        outs.printf("%10s", "Pending");
-        outs.printf("%15s%n", "Completed");
-
-        int pending;
-        long completed;
-
-        pending = 0;
-        for (int n : ms.getCommandPendingTasks().values())
-            pending += n;
-        completed = 0;
-        for (long n : ms.getCommandCompletedTasks().values())
-            completed += n;
-        outs.printf("%-25s%10s%10s%15s%n", "Commands", "n/a", pending, completed);
-
-        pending = 0;
-        for (int n : ms.getResponsePendingTasks().values())
-            pending += n;
-        completed = 0;
-        for (long n : ms.getResponseCompletedTasks().values())
-            completed += n;
-        outs.printf("%-25s%10s%10s%15s%n", "Responses", "n/a", pending, completed);
+        if (!probe.isStarting())
+        {
+	        outs.printf("Read Repair Statistics:%nAttempted: %d%nMismatch (Blocking): %d%nMismatch
(Background): %d%n", probe.getReadRepairAttempted(), probe.getReadRepairRepairedBlocking(),
probe.getReadRepairRepairedBackground());
+
+	        MessagingServiceMBean ms = probe.msProxy;
+	        outs.printf("%-25s", "Pool Name");
+	        outs.printf("%10s", "Active");
+	        outs.printf("%10s", "Pending");
+	        outs.printf("%15s%n", "Completed");
+
+	        int pending;
+	        long completed;
+
+	        pending = 0;
+	        for (int n : ms.getCommandPendingTasks().values())
+	            pending += n;
+	        completed = 0;
+	        for (long n : ms.getCommandCompletedTasks().values())
+	            completed += n;
+	        outs.printf("%-25s%10s%10s%15s%n", "Commands", "n/a", pending, completed);
+
+	        pending = 0;
+	        for (int n : ms.getResponsePendingTasks().values())
+	            pending += n;
+	        completed = 0;
+	        for (long n : ms.getResponseCompletedTasks().values())
+	            completed += n;
+	        outs.printf("%-25s%10s%10s%15s%n", "Responses", "n/a", pending, completed);
+        }
     }
 
     public void printCompactionStats(PrintStream outs)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/54b4b99e/src/java/org/apache/cassandra/tools/NodeProbe.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/NodeProbe.java b/src/java/org/apache/cassandra/tools/NodeProbe.java
index 261d416..3736659 100644
--- a/src/java/org/apache/cassandra/tools/NodeProbe.java
+++ b/src/java/org/apache/cassandra/tools/NodeProbe.java
@@ -602,6 +602,11 @@ public class NodeProbe
         return ssProxy.getOperationMode();
     }
 
+    public boolean isStarting()
+    {
+        return ssProxy.isStarting();
+    }
+
     public void truncate(String keyspaceName, String cfName)
     {
         try


Mime
View raw message