jrwest commented on code in PR #2246:
URL: https://github.com/apache/cassandra/pull/2246#discussion_r1157473624
##########
src/java/org/apache/cassandra/config/GuardrailsOptions.java:
##########
@@ -760,6 +762,70 @@ public void setZeroTTLOnTWCSEnabled(boolean value)
x -> config.zero_ttl_on_twcs_enabled = x);
}
+ @Override
+ public long getMaximumTimestampWarnThreshold(long currentTimestamp)
+ {
+ long configVal =
config.maximum_timestamp_warn_threshold.toMicroseconds();
+ return configVal == 0 ? Long.MAX_VALUE : currentTimestamp + configVal;
+ }
+
+ @Override
+ public void
setMaximumTimestampWarnThreshold(DurationSpec.LongMicrosecondsBound duration)
+ {
+ updatePropertyWithLogging("timestamp_warn_upper_bound",
+ duration,
+ () ->
config.maximum_timestamp_warn_threshold,
+ x -> config.maximum_timestamp_warn_threshold
= x);
+ }
+
+ @Override
+ public long getMaximumTimestampFailThreshold(long currentTimestamp)
+ {
+ long configVal =
config.maximum_timestamp_fail_threshold.toMicroseconds();
+ return configVal == 0 ? Long.MAX_VALUE : currentTimestamp + configVal;
+ }
+
+ @Override
+ public void
setMaximumTimestampFailThreshold(DurationSpec.LongMicrosecondsBound duration)
+ {
+ updatePropertyWithLogging("timestamp_fail_upper_bound",
+ duration,
+ () ->
config.maximum_timestamp_fail_threshold,
+ x -> config.maximum_timestamp_fail_threshold
= x);
+ }
+
+ @Override
+ public long getMinimumTimestampWarnThreshold(long currentTimestamp)
+ {
+ long configVal =
config.minimum_timestamp_warn_threshold.toMicroseconds();
+ return configVal == 0 ? Long.MIN_VALUE : currentTimestamp - configVal;
+ }
+
+ @Override
+ public void
setMinimumTimestampWarnThreshold(DurationSpec.LongMicrosecondsBound duration)
+ {
+ updatePropertyWithLogging("timestamp_warn_lower_bound",
+ duration,
Review Comment:
will fix
##########
src/java/org/apache/cassandra/config/GuardrailsOptions.java:
##########
@@ -760,6 +762,70 @@ public void setZeroTTLOnTWCSEnabled(boolean value)
x -> config.zero_ttl_on_twcs_enabled = x);
}
+ @Override
+ public long getMaximumTimestampWarnThreshold(long currentTimestamp)
+ {
+ long configVal =
config.maximum_timestamp_warn_threshold.toMicroseconds();
+ return configVal == 0 ? Long.MAX_VALUE : currentTimestamp + configVal;
+ }
+
+ @Override
+ public void
setMaximumTimestampWarnThreshold(DurationSpec.LongMicrosecondsBound duration)
+ {
+ updatePropertyWithLogging("timestamp_warn_upper_bound",
+ duration,
+ () ->
config.maximum_timestamp_warn_threshold,
+ x -> config.maximum_timestamp_warn_threshold
= x);
+ }
+
+ @Override
+ public long getMaximumTimestampFailThreshold(long currentTimestamp)
+ {
+ long configVal =
config.maximum_timestamp_fail_threshold.toMicroseconds();
+ return configVal == 0 ? Long.MAX_VALUE : currentTimestamp + configVal;
+ }
+
+ @Override
+ public void
setMaximumTimestampFailThreshold(DurationSpec.LongMicrosecondsBound duration)
+ {
+ updatePropertyWithLogging("timestamp_fail_upper_bound",
+ duration,
+ () ->
config.maximum_timestamp_fail_threshold,
+ x -> config.maximum_timestamp_fail_threshold
= x);
+ }
+
+ @Override
+ public long getMinimumTimestampWarnThreshold(long currentTimestamp)
+ {
+ long configVal =
config.minimum_timestamp_warn_threshold.toMicroseconds();
+ return configVal == 0 ? Long.MIN_VALUE : currentTimestamp - configVal;
+ }
+
+ @Override
+ public void
setMinimumTimestampWarnThreshold(DurationSpec.LongMicrosecondsBound duration)
+ {
+ updatePropertyWithLogging("timestamp_warn_lower_bound",
+ duration,
+ () ->
config.minimum_timestamp_warn_threshold,
+ x -> config.minimum_timestamp_warn_threshold
= x);
+ }
+
+ @Override
+ public long getMinimumTimestampFailThreshold(long currentTimestamp)
+ {
+ long configVal =
config.minimum_timestamp_fail_threshold.toMicroseconds();
+ return configVal == 0 ? Long.MIN_VALUE : currentTimestamp - configVal;
+ }
+
+ @Override
+ public void
setMinimumTimestampFailThreshold(DurationSpec.LongMicrosecondsBound duration)
+ {
+ updatePropertyWithLogging("timestamp_fail_lower_bound",
Review Comment:
will fix
--
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]