public class GuardrailsOptions extends java.lang.Object implements GuardrailsConfig
Note that the settings here must only be used to build the GuardrailsConfig
class and not directly by the
code checking each guarded constraint. That code should use the higher level abstractions defined in
Guardrails
).
We have 2 variants of guardrails, soft (warn) and hard (fail) limits, each guardrail having either one of the variants or both. Note in particular that hard limits only make sense for guardrails triggering during query execution. For other guardrails, say one triggering during compaction, aborting that compaction does not make sense.
Additionally, each individual setting should have a specific value (typically -1 for numeric settings), that allows to disable the corresponding guardrail.
Constructor and Description |
---|
GuardrailsOptions(Config config) |
public GuardrailsOptions(Config config)
public int getKeyspacesWarnThreshold()
getKeyspacesWarnThreshold
in interface GuardrailsConfig
public int getKeyspacesFailThreshold()
getKeyspacesFailThreshold
in interface GuardrailsConfig
public void setKeyspacesThreshold(int warn, int fail)
public int getTablesWarnThreshold()
getTablesWarnThreshold
in interface GuardrailsConfig
public int getTablesFailThreshold()
getTablesFailThreshold
in interface GuardrailsConfig
public void setTablesThreshold(int warn, int fail)
public int getColumnsPerTableWarnThreshold()
getColumnsPerTableWarnThreshold
in interface GuardrailsConfig
public int getColumnsPerTableFailThreshold()
getColumnsPerTableFailThreshold
in interface GuardrailsConfig
public void setColumnsPerTableThreshold(int warn, int fail)
public int getSecondaryIndexesPerTableWarnThreshold()
getSecondaryIndexesPerTableWarnThreshold
in interface GuardrailsConfig
public int getSecondaryIndexesPerTableFailThreshold()
getSecondaryIndexesPerTableFailThreshold
in interface GuardrailsConfig
public void setSecondaryIndexesPerTableThreshold(int warn, int fail)
public int getMaterializedViewsPerTableWarnThreshold()
getMaterializedViewsPerTableWarnThreshold
in interface GuardrailsConfig
public int getPartitionKeysInSelectWarnThreshold()
getPartitionKeysInSelectWarnThreshold
in interface GuardrailsConfig
public int getPartitionKeysInSelectFailThreshold()
getPartitionKeysInSelectFailThreshold
in interface GuardrailsConfig
public void setPartitionKeysInSelectThreshold(int warn, int fail)
public int getMaterializedViewsPerTableFailThreshold()
getMaterializedViewsPerTableFailThreshold
in interface GuardrailsConfig
public void setMaterializedViewsPerTableThreshold(int warn, int fail)
public int getPageSizeWarnThreshold()
getPageSizeWarnThreshold
in interface GuardrailsConfig
public int getPageSizeFailThreshold()
getPageSizeFailThreshold
in interface GuardrailsConfig
public void setPageSizeThreshold(int warn, int fail)
public java.util.Set<java.lang.String> getTablePropertiesWarned()
getTablePropertiesWarned
in interface GuardrailsConfig
public void setTablePropertiesWarned(java.util.Set<java.lang.String> properties)
public java.util.Set<java.lang.String> getTablePropertiesIgnored()
getTablePropertiesIgnored
in interface GuardrailsConfig
public void setTablePropertiesIgnored(java.util.Set<java.lang.String> properties)
public java.util.Set<java.lang.String> getTablePropertiesDisallowed()
getTablePropertiesDisallowed
in interface GuardrailsConfig
public void setTablePropertiesDisallowed(java.util.Set<java.lang.String> properties)
public boolean getUserTimestampsEnabled()
GuardrailsConfig
getUserTimestampsEnabled
in interface GuardrailsConfig
true
if user-provided timestamps are allowed, false
otherwise.public void setUserTimestampsEnabled(boolean enabled)
public boolean getGroupByEnabled()
GuardrailsConfig
getGroupByEnabled
in interface GuardrailsConfig
true
if allowed, false
otherwise.public void setGroupByEnabled(boolean enabled)
public boolean getDropTruncateTableEnabled()
GuardrailsConfig
getDropTruncateTableEnabled
in interface GuardrailsConfig
true
if allowed, false
otherwise.public void setDropTruncateTableEnabled(boolean enabled)
public boolean getSecondaryIndexesEnabled()
getSecondaryIndexesEnabled
in interface GuardrailsConfig
public void setSecondaryIndexesEnabled(boolean enabled)
public boolean getUncompressedTablesEnabled()
GuardrailsConfig
getUncompressedTablesEnabled
in interface GuardrailsConfig
true
if user's can disable compression, false
otherwise.public void setUncompressedTablesEnabled(boolean enabled)
public boolean getCompactTablesEnabled()
GuardrailsConfig
getCompactTablesEnabled
in interface GuardrailsConfig
true
if allowed, false
otherwise.public void setCompactTablesEnabled(boolean enabled)
public boolean getReadBeforeWriteListOperationsEnabled()
GuardrailsConfig
getReadBeforeWriteListOperationsEnabled
in interface GuardrailsConfig
true
if list operations that require read before write are allowed, false
otherwise.public void setReadBeforeWriteListOperationsEnabled(boolean enabled)
public boolean getAllowFilteringEnabled()
GuardrailsConfig
getAllowFilteringEnabled
in interface GuardrailsConfig
true
if ALLOW FILTERING is allowed, false
otherwise.public void setAllowFilteringEnabled(boolean enabled)
public int getInSelectCartesianProductWarnThreshold()
getInSelectCartesianProductWarnThreshold
in interface GuardrailsConfig
public int getInSelectCartesianProductFailThreshold()
getInSelectCartesianProductFailThreshold
in interface GuardrailsConfig
public void setInSelectCartesianProductThreshold(int warn, int fail)
public java.util.Set<ConsistencyLevel> getReadConsistencyLevelsWarned()
getReadConsistencyLevelsWarned
in interface GuardrailsConfig
public void setReadConsistencyLevelsWarned(java.util.Set<ConsistencyLevel> consistencyLevels)
public java.util.Set<ConsistencyLevel> getReadConsistencyLevelsDisallowed()
getReadConsistencyLevelsDisallowed
in interface GuardrailsConfig
public void setReadConsistencyLevelsDisallowed(java.util.Set<ConsistencyLevel> consistencyLevels)
public java.util.Set<ConsistencyLevel> getWriteConsistencyLevelsWarned()
getWriteConsistencyLevelsWarned
in interface GuardrailsConfig
public void setWriteConsistencyLevelsWarned(java.util.Set<ConsistencyLevel> consistencyLevels)
public java.util.Set<ConsistencyLevel> getWriteConsistencyLevelsDisallowed()
getWriteConsistencyLevelsDisallowed
in interface GuardrailsConfig
public void setWriteConsistencyLevelsDisallowed(java.util.Set<ConsistencyLevel> consistencyLevels)
@Nullable public DataStorageSpec.LongBytesBound getCollectionSizeWarnThreshold()
getCollectionSizeWarnThreshold
in interface GuardrailsConfig
@Nullable public DataStorageSpec.LongBytesBound getCollectionSizeFailThreshold()
getCollectionSizeFailThreshold
in interface GuardrailsConfig
public void setCollectionSizeThreshold(@Nullable DataStorageSpec.LongBytesBound warn, @Nullable DataStorageSpec.LongBytesBound fail)
public int getItemsPerCollectionWarnThreshold()
getItemsPerCollectionWarnThreshold
in interface GuardrailsConfig
public int getItemsPerCollectionFailThreshold()
getItemsPerCollectionFailThreshold
in interface GuardrailsConfig
public void setItemsPerCollectionThreshold(int warn, int fail)
public int getFieldsPerUDTWarnThreshold()
getFieldsPerUDTWarnThreshold
in interface GuardrailsConfig
public int getFieldsPerUDTFailThreshold()
getFieldsPerUDTFailThreshold
in interface GuardrailsConfig
public void setFieldsPerUDTThreshold(int warn, int fail)
public int getDataDiskUsagePercentageWarnThreshold()
getDataDiskUsagePercentageWarnThreshold
in interface GuardrailsConfig
[1, 100]
, and -1 means disabled.public int getDataDiskUsagePercentageFailThreshold()
getDataDiskUsagePercentageFailThreshold
in interface GuardrailsConfig
[1, 100]
, and -1 means disabled.public void setDataDiskUsagePercentageThreshold(int warn, int fail)
public DataStorageSpec.LongBytesBound getDataDiskUsageMaxDiskSize()
getDataDiskUsageMaxDiskSize
in interface GuardrailsConfig
null
means
disabled.public void setDataDiskUsageMaxDiskSize(@Nullable DataStorageSpec.LongBytesBound diskSize)
public int getMinimumReplicationFactorWarnThreshold()
getMinimumReplicationFactorWarnThreshold
in interface GuardrailsConfig
public int getMinimumReplicationFactorFailThreshold()
getMinimumReplicationFactorFailThreshold
in interface GuardrailsConfig
public void setMinimumReplicationFactorThreshold(int warn, int fail)
Copyright © 2009-2022 The Apache Software Foundation