smiklosovic commented on code in PR #4515:
URL: https://github.com/apache/cassandra/pull/4515#discussion_r2594149971
##########
src/java/org/apache/cassandra/service/disk/usage/DiskUsageMonitor.java:
##########
@@ -79,14 +81,28 @@ public void start(Consumer<DiskUsageState> notifier)
{
// start the scheduler regardless guardrail is enabled, so we can
enable it later without a restart
ScheduledExecutors.scheduledTasks.scheduleAtFixedRate(() -> {
-
- if (!Guardrails.localDataDiskUsage.enabled(null))
+ boolean currentEnabledStatus =
Guardrails.localDataDiskUsage.enabled(null);
Review Comment:
what about this
boolean oldEnabledStatus =
enabled.getAndSet(Guardrails.localDataDiskUsage.enabled(null));
if (!enabled.get())
{
if (oldEnabledStatus)
onDiskUsageGuardrailDisabled(notifier);
return;
}
what is here is just too verbose to my taste
--
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]