Repository: cassandra Updated Branches: refs/heads/trunk 6e19e81db -> cf4a0576a
Allow to set batch_size_warn_threshold_in_kb via JMX patch by Romain Hardouin; reviewed by Jeff Jirsa for CASSANDRA-13699 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/cf4a0576 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/cf4a0576 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/cf4a0576 Branch: refs/heads/trunk Commit: cf4a0576a6f2b8f2d828a8b14140f212803adb7c Parents: 6e19e81 Author: Romain Hardouin <[email protected]> Authored: Wed Jul 19 22:10:59 2017 +0200 Committer: Jeff Jirsa <[email protected]> Committed: Wed Jul 26 16:29:53 2017 -0700 ---------------------------------------------------------------------- CHANGES.txt | 5 +++-- .../org/apache/cassandra/config/DatabaseDescriptor.java | 5 +++++ .../org/apache/cassandra/service/StorageService.java | 12 ++++++++++++ .../apache/cassandra/service/StorageServiceMBean.java | 5 +++++ 4 files changed, 25 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/cf4a0576/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index b4880fb..7189cb4 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,7 +1,8 @@ 4.0 + * batch_size_warn_threshold_in_kb can now be set at runtime (CASSANDRA-13699) * Avoid always rebuilding secondary indexes at startup (CASSANDRA-13725) - * Upgrade JMH from 1.13 to 1.19 - * Upgrade SLF4J from 1.7.7 to 1.7.25 + * Upgrade JMH from 1.13 to 1.19 (CASSANDRA-13727) + * Upgrade SLF4J from 1.7.7 to 1.7.25 (CASSANDRA-12996) * Default for start_native_transport now true if not set in config (CASSANDRA-13656) * Don't add localhost to the graph when calculating where to stream from (CASSANDRA-13583) * Allow skipping equality-restricted clustering columns in ORDER BY clause (CASSANDRA-10271) http://git-wip-us.apache.org/repos/asf/cassandra/blob/cf4a0576/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 e369982..208605d 100644 --- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java +++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java @@ -1157,6 +1157,11 @@ public class DatabaseDescriptor return conf.batch_size_warn_threshold_in_kb * 1024; } + public static int getBatchSizeWarnThresholdInKB() + { + return conf.batch_size_warn_threshold_in_kb; + } + public static long getBatchSizeFailThreshold() { return conf.batch_size_fail_threshold_in_kb * 1024L; http://git-wip-us.apache.org/repos/asf/cassandra/blob/cf4a0576/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 a3d3791..9070e89 100644 --- a/src/java/org/apache/cassandra/service/StorageService.java +++ b/src/java/org/apache/cassandra/service/StorageService.java @@ -4982,6 +4982,18 @@ public class StorageService extends NotificationBroadcasterSupport implements IE public void setBatchSizeFailureThreshold(int threshold) { DatabaseDescriptor.setBatchSizeFailThresholdInKB(threshold); + logger.info("Updated batch_size_fail_threshold_in_kb to {}", threshold); + } + + public int getBatchSizeWarnThreshold() + { + return DatabaseDescriptor.getBatchSizeWarnThresholdInKB(); + } + + public void setBatchSizeWarnThreshold(int threshold) + { + DatabaseDescriptor.setBatchSizeWarnThresholdInKB(threshold); + logger.info("Updated batch_size_warn_threshold_in_kb to {}", threshold); } public void setHintedHandoffThrottleInKB(int throttleInKB) http://git-wip-us.apache.org/repos/asf/cassandra/blob/cf4a0576/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 bd8aca6..36c43fd 100644 --- a/src/java/org/apache/cassandra/service/StorageServiceMBean.java +++ b/src/java/org/apache/cassandra/service/StorageServiceMBean.java @@ -620,6 +620,11 @@ public interface StorageServiceMBean extends NotificationEmitter /** Sets the threshold for rejecting queries due to a large batch size */ public void setBatchSizeFailureThreshold(int batchSizeDebugThreshold); + /** Returns the threshold for warning queries due to a large batch size */ + public int getBatchSizeWarnThreshold(); + /** Sets the threshold for warning queries due to a large batch size */ + public void setBatchSizeWarnThreshold(int batchSizeDebugThreshold); + /** Sets the hinted handoff throttle in kb per second, per delivery thread. */ public void setHintedHandoffThrottleInKB(int throttleInKB); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
