minal-kyada commented on code in PR #4556:
URL: https://github.com/apache/cassandra/pull/4556#discussion_r2886235139
##########
src/java/org/apache/cassandra/config/DatabaseDescriptor.java:
##########
@@ -5482,6 +5470,40 @@ public static void
setRowIndexReadSizeFailThreshold(@Nullable DataStorageSpec.Lo
conf.row_index_read_size_fail_threshold = value;
}
+ public static boolean getWriteThresholdsEnabled()
+ {
+ return conf.write_thresholds_enabled;
+ }
+
+ public static void setWriteThresholdsEnabled(boolean enabled)
+ {
+ logger.info("updating write_thresholds_enabled to {}", enabled);
+ conf.write_thresholds_enabled = enabled;
+ }
+
+ @Nullable
+ public static DataStorageSpec.LongBytesBound getWriteSizeWarnThreshold()
+ {
+ return conf.write_size_warn_threshold;
+ }
+
+ public static void setWriteSizeWarnThreshold(@Nullable
DataStorageSpec.LongBytesBound value)
+ {
+ logger.info("updating write_size_warn_threshold to {}", value);
+ conf.write_size_warn_threshold = value;
Review Comment:
Using the existing `validateWriteSizeThreshold` method which already does
the right check - if value < min_tracked_partition_size, it throws a
ConfigurationException. The validation runs before the assignment, so the
config stays consistent.
Also made sure that null values are handled gracefully, passing null to
disable the threshold will still work fine.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]