cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject [1/3] git commit: Setting severity via JMX broken patch by Vijay; reviewed by rbranson for CASSANDRA-6996
Date Wed, 23 Apr 2014 04:36:26 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 99fbafee3 -> 902925716


Setting severity via JMX broken
patch by Vijay; reviewed by rbranson for CASSANDRA-6996


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

Branch: refs/heads/trunk
Commit: 4e4d7bbcb254285a1031cb232b3fe7af326e9da3
Parents: b9324e1
Author: Vijay <vijay2win@gmail.com>
Authored: Tue Apr 22 21:30:38 2014 -0700
Committer: Vijay <vijay2win@gmail.com>
Committed: Tue Apr 22 21:30:38 2014 -0700

----------------------------------------------------------------------
 .../org/apache/cassandra/locator/DynamicEndpointSnitch.java   | 2 +-
 src/java/org/apache/cassandra/service/StorageService.java     | 5 +++++
 .../org/apache/cassandra/utils/BackgroundActivityMonitor.java | 7 +++++++
 3 files changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/4e4d7bbc/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java b/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
index 00c3618..c76a196 100644
--- a/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
+++ b/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
@@ -300,7 +300,7 @@ public class DynamicEndpointSnitch extends AbstractEndpointSnitch implements
ILa
 
     public void setSeverity(double severity)
     {
-        StorageService.instance.reportSeverity(severity);
+        StorageService.instance.reportManualSeverity(severity);
     }
 
     public double getSeverity()

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4e4d7bbc/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 7382cbd..75f6427 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -1054,6 +1054,11 @@ public class StorageService extends NotificationBroadcasterSupport
implements IE
         bgMonitor.incrCompactionSeverity(incr);
     }
 
+    public void reportManualSeverity(double incr)
+    {
+        bgMonitor.incrManualSeverity(incr);
+    }
+
     public double getSeverity(InetAddress endpoint)
     {
         return bgMonitor.getSeverity(endpoint);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4e4d7bbc/src/java/org/apache/cassandra/utils/BackgroundActivityMonitor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/BackgroundActivityMonitor.java b/src/java/org/apache/cassandra/utils/BackgroundActivityMonitor.java
index bad9a17..93906eb 100644
--- a/src/java/org/apache/cassandra/utils/BackgroundActivityMonitor.java
+++ b/src/java/org/apache/cassandra/utils/BackgroundActivityMonitor.java
@@ -56,6 +56,7 @@ public class BackgroundActivityMonitor
     private static final String PROC_STAT_PATH = "/proc/stat";
 
     private final AtomicDouble compaction_severity = new AtomicDouble();
+    private final AtomicDouble manual_severity = new AtomicDouble();
     private final ScheduledExecutorService reportThread = new DebuggableScheduledThreadPoolExecutor("Background_Reporter");
 
     private RandomAccessFile statsFile;
@@ -112,6 +113,11 @@ public class BackgroundActivityMonitor
         compaction_severity.addAndGet(sev);
     }
 
+    public void incrManualSeverity(double sev)
+    {
+        manual_severity.addAndGet(sev);
+    }
+
     public double getIOWait() throws IOException
     {
         if (statsFile == null)
@@ -157,6 +163,7 @@ public class BackgroundActivityMonitor
 
             if (!Gossiper.instance.isEnabled())
                 return;
+            report += manual_severity.get(); // add manual severity setting.
             VersionedValue updated = StorageService.instance.valueFactory.severity(report);
             Gossiper.instance.addLocalApplicationState(ApplicationState.SEVERITY, updated);
         }


Mime
View raw message