cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject cassandra git commit: Changing `max_hint_window_in_ms` at runtime
Date Wed, 10 May 2017 03:11:13 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 2304363e4 -> 981e3b3c7


Changing `max_hint_window_in_ms` at runtime

 patch by Hiroyuki Nishi; reviewed by Mick Semb Wever for CASSANDRA-11720


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

Branch: refs/heads/trunk
Commit: 981e3b3c76b7cd6ed1ef318e4cd7ddfb2910be31
Parents: 2304363
Author: Mick Semb Wever <mck@apache.org>
Authored: Wed May 3 06:37:11 2017 +1000
Committer: Mick Semb Wever <mck@apache.org>
Committed: Wed May 10 13:08:41 2017 +1000

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../org/apache/cassandra/tools/NodeProbe.java   | 10 ++++++
 .../org/apache/cassandra/tools/NodeTool.java    |  2 ++
 .../tools/nodetool/GetMaxHintWindow.java        | 33 +++++++++++++++++
 .../tools/nodetool/SetMaxHintWindow.java        | 37 ++++++++++++++++++++
 5 files changed, 83 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/981e3b3c/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 93096fe..7f72f30 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -60,6 +60,7 @@
  * Add support for arithmetic operators (CASSANDRA-11935)
  * Add histogram for delay to deliver hints (CASSANDRA-13234)
  * Fix cqlsh automatic protocol downgrade regression (CASSANDRA-13307)
+ * Changing `max_hint_window_in_ms` at runtime (CASSANDRA-11720)
 
 
 3.11.0

http://git-wip-us.apache.org/repos/asf/cassandra/blob/981e3b3c/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 865665c..8a1ab74 100644
--- a/src/java/org/apache/cassandra/tools/NodeProbe.java
+++ b/src/java/org/apache/cassandra/tools/NodeProbe.java
@@ -1011,6 +1011,16 @@ public class NodeProbe implements AutoCloseable
         return ssProxy.getConcurrentCompactors();
     }
 
+    public void setMaxHintWindow(int value)
+    {
+        spProxy.setMaxHintWindow(value);
+    }
+
+    public int getMaxHintWindow()
+    {
+        return spProxy.getMaxHintWindow();
+    }
+
     public long getTimeout(String type)
     {
         switch (type)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/981e3b3c/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 20f7f17..22c6b09 100644
--- a/src/java/org/apache/cassandra/tools/NodeTool.java
+++ b/src/java/org/apache/cassandra/tools/NodeTool.java
@@ -85,6 +85,7 @@ public class NodeTool
                 GetInterDCStreamThroughput.class,
                 GetEndpoints.class,
                 GetSSTables.class,
+                GetMaxHintWindow.class,
                 GossipInfo.class,
                 InvalidateKeyCache.class,
                 InvalidateRowCache.class,
@@ -111,6 +112,7 @@ public class NodeTool
                 SetStreamThroughput.class,
                 SetInterDCStreamThroughput.class,
                 SetTraceProbability.class,
+                SetMaxHintWindow.class,
                 Snapshot.class,
                 ListSnapshots.class,
                 Status.class,

http://git-wip-us.apache.org/repos/asf/cassandra/blob/981e3b3c/src/java/org/apache/cassandra/tools/nodetool/GetMaxHintWindow.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/nodetool/GetMaxHintWindow.java b/src/java/org/apache/cassandra/tools/nodetool/GetMaxHintWindow.java
new file mode 100644
index 0000000..280d70c
--- /dev/null
+++ b/src/java/org/apache/cassandra/tools/nodetool/GetMaxHintWindow.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cassandra.tools.nodetool;
+
+import io.airlift.command.Command;
+import org.apache.cassandra.tools.NodeProbe;
+import org.apache.cassandra.tools.NodeTool;
+
+@Command(name = "getmaxhintwindow", description = "Print the max hint window in ms")
+public class GetMaxHintWindow extends NodeTool.NodeToolCmd
+{
+    @Override
+    public void execute(NodeProbe probe)
+    {
+        System.out.println("Current max hint window: " + probe.getMaxHintWindow() + " ms");
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cassandra/blob/981e3b3c/src/java/org/apache/cassandra/tools/nodetool/SetMaxHintWindow.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/nodetool/SetMaxHintWindow.java b/src/java/org/apache/cassandra/tools/nodetool/SetMaxHintWindow.java
new file mode 100644
index 0000000..0fb809a
--- /dev/null
+++ b/src/java/org/apache/cassandra/tools/nodetool/SetMaxHintWindow.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cassandra.tools.nodetool;
+
+import io.airlift.command.Arguments;
+import io.airlift.command.Command;
+import org.apache.cassandra.tools.NodeProbe;
+import org.apache.cassandra.tools.NodeTool;
+
+@Command(name = "setmaxhintwindow", description = "Set the specified max hint window in ms")
+public class SetMaxHintWindow extends NodeTool.NodeToolCmd
+{
+    @Arguments(title = "max_hint_window", usage = "<value_in_ms>", description = "Value
of maxhintwindow in ms", required = true)
+    private Integer maxHintWindow = null;
+
+    @Override
+    public void execute(NodeProbe probe)
+    {
+        probe.setMaxHintWindow(maxHintWindow);
+    }
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


Mime
View raw message