cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xe...@apache.org
Subject [5/5] git commit: Allow setting rpc_timeout via JMX. Patch by Ruben Terrazas, reviewed by brandonwilliams for CASSANDRA-2940
Date Sat, 07 Jan 2012 14:39:24 GMT
Allow setting rpc_timeout via JMX.
Patch by Ruben Terrazas, reviewed by brandonwilliams for CASSANDRA-2940


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

Branch: refs/heads/trunk
Commit: eca0c4856fbc42d833aead796c82fc2939cbfd5b
Parents: 17d2c8a
Author: Brandon Williams <brandonwilliams@apache.org>
Authored: Thu Jan 5 15:47:50 2012 -0600
Committer: Brandon Williams <brandonwilliams@apache.org>
Committed: Thu Jan 5 15:47:50 2012 -0600

----------------------------------------------------------------------
 .../cassandra/config/DatabaseDescriptor.java       |    5 +++++
 .../org/apache/cassandra/service/StorageProxy.java |   10 ++++++++++
 .../cassandra/service/StorageProxyMBean.java       |    3 +++
 3 files changed, 18 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/eca0c485/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index 9443931..03b5175 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -647,6 +647,11 @@ public class DatabaseDescriptor
         return conf.rpc_timeout_in_ms;
     }
 
+    public static void setRpcTimeout(Long timeOutInMillis)
+    {
+        conf.rpc_timeout_in_ms = timeOutInMillis;
+    }
+
     public static int getPhiConvictThreshold()
     {
         return conf.phi_convict_threshold;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/eca0c485/src/java/org/apache/cassandra/service/StorageProxy.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StorageProxy.java b/src/java/org/apache/cassandra/service/StorageProxy.java
index 9be3ea7..0672b3f 100644
--- a/src/java/org/apache/cassandra/service/StorageProxy.java
+++ b/src/java/org/apache/cassandra/service/StorageProxy.java
@@ -1256,4 +1256,14 @@ public class StorageProxy implements StorageProxyMBean
         if (getHintsInProgress() > 0)
             logger.warn("Some hints were not written before shutdown.  This is not supposed
to happen.  You should (a) run repair, and (b) file a bug report");
     }
+
+    public Long getRpcTimeout()
+    {
+        return DatabaseDescriptor.getRpcTimeout();
+    }
+
+    public void setRpcTimeout(Long timeoutInMillis)
+    {
+        DatabaseDescriptor.setRpcTimeout(timeoutInMillis);
+    }
 }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/eca0c485/src/java/org/apache/cassandra/service/StorageProxyMBean.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StorageProxyMBean.java b/src/java/org/apache/cassandra/service/StorageProxyMBean.java
index 25c395a..7f8198b 100644
--- a/src/java/org/apache/cassandra/service/StorageProxyMBean.java
+++ b/src/java/org/apache/cassandra/service/StorageProxyMBean.java
@@ -46,4 +46,7 @@ public interface StorageProxyMBean
     public int getMaxHintsInProgress();
     public void setMaxHintsInProgress(int qs);
     public int getHintsInProgress();
+
+    public Long getRpcTimeout();
+    public void setRpcTimeout(Long timeoutInMillis);
 }


Mime
View raw message