Add get/setDataDiskUsageKeyspaceWideProtectionEnabled to GuardrailsConfig

This was forgotten in the original patch.

patch by Stefan Miklosovic; reviewed by Paulo Motta for CASSANDRA-21024
This commit is contained in:
Stefan Miklosovic 2026-05-21 21:53:35 +02:00
parent 1f078c0daf
commit b3bc7c019f
No known key found for this signature in database
GPG Key ID: 32F35CB2F546D93E
2 changed files with 15 additions and 1 deletions

View File

@ -996,12 +996,13 @@ public class GuardrailsOptions implements GuardrailsConfig
x -> config.data_disk_usage_percentage_fail_threshold = x);
}
@Override
public boolean getDataDiskUsageKeyspaceWideProtectionEnabled()
{
return config.data_disk_usage_keyspace_wide_protection_enabled;
}
@Override
public void setDataDiskUsageKeyspaceWideProtectionEnabled(boolean enabled)
{
updatePropertyWithLogging("data_disk_usage_keyspace_wide_protection_enabled",

View File

@ -436,6 +436,19 @@ public interface GuardrailsConfig
*/
int getDataDiskUsagePercentageFailThreshold();
/**
* @return Whether a single node replicating a given keyspace being full should block writes for the entire
* keyspace. Returns {@code true} if this behavior is enabled, {@code false} otherwise.
*/
boolean getDataDiskUsageKeyspaceWideProtectionEnabled();
/**
* Enables or disables blocking writes for a keyspace when any node replicating that keyspace is full.
*
* @param enabled {@code true} to block writes keyspace-wide once a replica is full, {@code false} to disable.
*/
void setDataDiskUsageKeyspaceWideProtectionEnabled(boolean enabled);
/**
* @return The max disk size of the data directories when calculating disk usage thresholds, {@code null} means
* disabled.