Repository: cassandra Updated Branches: refs/heads/cassandra-2.0 d1c4d50ee -> f83909e04 refs/heads/cassandra-2.1 9394f0d9a -> 7fc89ad7f refs/heads/trunk 774f3acbf -> 94cfec89b
Add 'nodetool sethintedhandoffthrottlekb' patch by lyubent; reviewed by slebresne for CASSANDRA-7635 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/d1c4d50e Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/d1c4d50e Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/d1c4d50e Branch: refs/heads/trunk Commit: d1c4d50ee05cb6be19d60c2e58a19b0e1fb93023 Parents: f498a94 Author: Sylvain Lebresne <sylv...@datastax.com> Authored: Wed Aug 6 12:47:14 2014 +0200 Committer: Sylvain Lebresne <sylv...@datastax.com> Committed: Wed Aug 6 12:47:14 2014 +0200 ---------------------------------------------------------------------- CHANGES.txt | 1 + src/java/org/apache/cassandra/config/DatabaseDescriptor.java | 5 +++++ src/java/org/apache/cassandra/service/StorageService.java | 6 ++++++ .../org/apache/cassandra/service/StorageServiceMBean.java | 3 +++ src/java/org/apache/cassandra/tools/NodeCmd.java | 8 +++++++- src/java/org/apache/cassandra/tools/NodeProbe.java | 5 +++++ src/resources/org/apache/cassandra/tools/NodeToolHelp.yaml | 3 +++ 7 files changed, 30 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/d1c4d50e/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 30efd94..87b1bb3 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 2.0.10 + * Add 'nodetool sethintedhandoffthrottlekb' (CASSANDRA-7635) * Update java driver (for hadoop) (CASSANDRA-7618) * Fix truncate to always flush (CASSANDRA-7511) * Remove shuffle and taketoken (CASSANDRA-7601) http://git-wip-us.apache.org/repos/asf/cassandra/blob/d1c4d50e/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 836edfd..1ca7975 100644 --- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java +++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java @@ -1250,6 +1250,11 @@ public class DatabaseDescriptor return conf.hinted_handoff_throttle_in_kb; } + public static void setHintedHandoffThrottleInKB(Integer throttleInKB) + { + conf.hinted_handoff_throttle_in_kb = throttleInKB; + } + public static int getBatchlogReplayThrottleInKB() { return conf.batchlog_replay_throttle_in_kb; http://git-wip-us.apache.org/repos/asf/cassandra/blob/d1c4d50e/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 97ae908..d5b5289 100644 --- a/src/java/org/apache/cassandra/service/StorageService.java +++ b/src/java/org/apache/cassandra/service/StorageService.java @@ -3832,4 +3832,10 @@ public class StorageService extends NotificationBroadcasterSupport implements IE { DatabaseDescriptor.setTombstoneFailureThreshold(threshold); } + + public void setHintedHandoffThrottleInKB(int throttleInKB) + { + DatabaseDescriptor.setHintedHandoffThrottleInKB(throttleInKB); + logger.info(String.format("Updated hinted_handoff_throttle_in_kb to %d", throttleInKB)); + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/d1c4d50e/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 f578e10..6308aa5 100644 --- a/src/java/org/apache/cassandra/service/StorageServiceMBean.java +++ b/src/java/org/apache/cassandra/service/StorageServiceMBean.java @@ -505,4 +505,7 @@ public interface StorageServiceMBean extends NotificationEmitter public int getTombstoneFailureThreshold(); /** Sets the threshold for abandoning queries with many tombstones */ public void setTombstoneFailureThreshold(int tombstoneDebugThreshold); + + /** Sets the hinted handoff throttle in kb per second, per delivery thread. */ + public void setHintedHandoffThrottleInKB(int throttleInKB); } http://git-wip-us.apache.org/repos/asf/cassandra/blob/d1c4d50e/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 1d156ad..aeed913 100644 --- a/src/java/org/apache/cassandra/tools/NodeCmd.java +++ b/src/java/org/apache/cassandra/tools/NodeCmd.java @@ -188,7 +188,8 @@ public class NodeCmd SETCACHEKEYSTOSAVE, RELOADTRIGGERS, SETLOGGINGLEVEL, - GETLOGGINGLEVELS + GETLOGGINGLEVELS, + SETHINTEDHANDOFFTHROTTLEKB } @@ -1250,6 +1251,11 @@ public class NodeCmd case ENABLEBACKUP : probe.setIncrementalBackupsEnabled(true); break; case DISABLEBACKUP : probe.setIncrementalBackupsEnabled(false); break; + case SETHINTEDHANDOFFTHROTTLEKB: + if (arguments.length != 1) { badUse("Missing argument for hinted handoff throttle."); } + probe.setHintedHandoffThrottleInKB(Integer.parseInt(arguments[0])); + break; + case TRUNCATEHINTS: if (arguments.length > 1) badUse("Too many arguments."); else if (arguments.length == 1) probe.truncateHints(arguments[0]); http://git-wip-us.apache.org/repos/asf/cassandra/blob/d1c4d50e/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 d7ded89..d281219 100644 --- a/src/java/org/apache/cassandra/tools/NodeProbe.java +++ b/src/java/org/apache/cassandra/tools/NodeProbe.java @@ -529,6 +529,11 @@ public class NodeProbe ssProxy.setIncrementalBackupsEnabled(enabled); } + public void setHintedHandoffThrottleInKB(int throttleInKb) + { + ssProxy.setHintedHandoffThrottleInKB(throttleInKb); + } + public void setCacheCapacities(int keyCacheCapacity, int rowCacheCapacity) { try http://git-wip-us.apache.org/repos/asf/cassandra/blob/d1c4d50e/src/resources/org/apache/cassandra/tools/NodeToolHelp.yaml ---------------------------------------------------------------------- diff --git a/src/resources/org/apache/cassandra/tools/NodeToolHelp.yaml b/src/resources/org/apache/cassandra/tools/NodeToolHelp.yaml index 6f57846..416ef1a 100644 --- a/src/resources/org/apache/cassandra/tools/NodeToolHelp.yaml +++ b/src/resources/org/apache/cassandra/tools/NodeToolHelp.yaml @@ -223,3 +223,6 @@ commands: - name: getlogginglevels help: | Get the runtime logging levels + - name: sethintedhandoffthrottlekb <throttle-in-kb> + help: | + Set hinted handoff throttle in kb per second, per delivery thread.