Package org.apache.cassandra.config
Class GuardrailsOptions
- java.lang.Object
-
- org.apache.cassandra.config.GuardrailsOptions
-
- All Implemented Interfaces:
GuardrailsConfig
public class GuardrailsOptions extends java.lang.Object implements GuardrailsConfig
Configuration settings for guardrails populated from the Yaml file.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 inGuardrails
).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 Summary
Constructors Constructor Description GuardrailsOptions(Config config)
-
Method Summary
-
-
-
Constructor Detail
-
GuardrailsOptions
public GuardrailsOptions(Config config)
-
-
Method Detail
-
getKeyspacesWarnThreshold
public int getKeyspacesWarnThreshold()
- Specified by:
getKeyspacesWarnThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to warn when creating more user keyspaces than threshold.
-
getKeyspacesFailThreshold
public int getKeyspacesFailThreshold()
- Specified by:
getKeyspacesFailThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to fail when creating more user keyspaces than threshold.
-
setKeyspacesThreshold
public void setKeyspacesThreshold(int warn, int fail)
-
getTablesWarnThreshold
public int getTablesWarnThreshold()
- Specified by:
getTablesWarnThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to warn when creating more user tables than threshold.
-
getTablesFailThreshold
public int getTablesFailThreshold()
- Specified by:
getTablesFailThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to fail when creating more user tables than threshold.
-
setTablesThreshold
public void setTablesThreshold(int warn, int fail)
-
getColumnsPerTableWarnThreshold
public int getColumnsPerTableWarnThreshold()
- Specified by:
getColumnsPerTableWarnThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to warn when creating more columns per table than threshold.
-
getColumnsPerTableFailThreshold
public int getColumnsPerTableFailThreshold()
- Specified by:
getColumnsPerTableFailThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to fail when creating more columns per table than threshold.
-
setColumnsPerTableThreshold
public void setColumnsPerTableThreshold(int warn, int fail)
-
getSecondaryIndexesPerTableWarnThreshold
public int getSecondaryIndexesPerTableWarnThreshold()
- Specified by:
getSecondaryIndexesPerTableWarnThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to warn when creating more secondary indexes per table than threshold.
-
getSecondaryIndexesPerTableFailThreshold
public int getSecondaryIndexesPerTableFailThreshold()
- Specified by:
getSecondaryIndexesPerTableFailThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to fail when creating more secondary indexes per table than threshold.
-
setSecondaryIndexesPerTableThreshold
public void setSecondaryIndexesPerTableThreshold(int warn, int fail)
-
getMaterializedViewsPerTableWarnThreshold
public int getMaterializedViewsPerTableWarnThreshold()
- Specified by:
getMaterializedViewsPerTableWarnThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to warn when creating more materialized views per table than threshold.
-
getPartitionKeysInSelectWarnThreshold
public int getPartitionKeysInSelectWarnThreshold()
- Specified by:
getPartitionKeysInSelectWarnThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to warn when partition keys in select more than threshold.
-
getPartitionKeysInSelectFailThreshold
public int getPartitionKeysInSelectFailThreshold()
- Specified by:
getPartitionKeysInSelectFailThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to fail when partition keys in select more than threshold.
-
setPartitionKeysInSelectThreshold
public void setPartitionKeysInSelectThreshold(int warn, int fail)
-
getMaterializedViewsPerTableFailThreshold
public int getMaterializedViewsPerTableFailThreshold()
- Specified by:
getMaterializedViewsPerTableFailThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to fail when creating more materialized views per table than threshold.
-
setMaterializedViewsPerTableThreshold
public void setMaterializedViewsPerTableThreshold(int warn, int fail)
-
getPageSizeWarnThreshold
public int getPageSizeWarnThreshold()
- Specified by:
getPageSizeWarnThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to warn when page size exceeds given size.
-
getPageSizeFailThreshold
public int getPageSizeFailThreshold()
- Specified by:
getPageSizeFailThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to fail when page size exceeds given size.
-
setPageSizeThreshold
public void setPageSizeThreshold(int warn, int fail)
-
getTablePropertiesWarned
public java.util.Set<java.lang.String> getTablePropertiesWarned()
- Specified by:
getTablePropertiesWarned
in interfaceGuardrailsConfig
- Returns:
- The table properties that are warned about when creating or altering a table.
-
setTablePropertiesWarned
public void setTablePropertiesWarned(java.util.Set<java.lang.String> properties)
-
getTablePropertiesIgnored
public java.util.Set<java.lang.String> getTablePropertiesIgnored()
- Specified by:
getTablePropertiesIgnored
in interfaceGuardrailsConfig
- Returns:
- The table properties that are ignored when creating or altering a table.
-
setTablePropertiesIgnored
public void setTablePropertiesIgnored(java.util.Set<java.lang.String> properties)
-
getTablePropertiesDisallowed
public java.util.Set<java.lang.String> getTablePropertiesDisallowed()
- Specified by:
getTablePropertiesDisallowed
in interfaceGuardrailsConfig
- Returns:
- The table properties that are disallowed when creating or altering a table.
-
setTablePropertiesDisallowed
public void setTablePropertiesDisallowed(java.util.Set<java.lang.String> properties)
-
getUserTimestampsEnabled
public boolean getUserTimestampsEnabled()
Description copied from interface:GuardrailsConfig
Returns whether user-provided timestamps are allowed.- Specified by:
getUserTimestampsEnabled
in interfaceGuardrailsConfig
- Returns:
true
if user-provided timestamps are allowed,false
otherwise.
-
setUserTimestampsEnabled
public void setUserTimestampsEnabled(boolean enabled)
-
getGroupByEnabled
public boolean getGroupByEnabled()
Description copied from interface:GuardrailsConfig
Returns whether GROUP BY functionality is allowed- Specified by:
getGroupByEnabled
in interfaceGuardrailsConfig
- Returns:
true
if allowed,false
otherwise.
-
setGroupByEnabled
public void setGroupByEnabled(boolean enabled)
-
getDropTruncateTableEnabled
public boolean getDropTruncateTableEnabled()
Description copied from interface:GuardrailsConfig
Returns whether TRUNCATE or DROP table are allowed- Specified by:
getDropTruncateTableEnabled
in interfaceGuardrailsConfig
- Returns:
true
if allowed,false
otherwise.
-
setDropTruncateTableEnabled
public void setDropTruncateTableEnabled(boolean enabled)
-
getDropKeyspaceEnabled
public boolean getDropKeyspaceEnabled()
Description copied from interface:GuardrailsConfig
Returns whether DROP on keyspaces is allowed- Specified by:
getDropKeyspaceEnabled
in interfaceGuardrailsConfig
- Returns:
true
if allowed,false
otherwise.
-
setDropKeyspaceEnabled
public void setDropKeyspaceEnabled(boolean enabled)
-
getSecondaryIndexesEnabled
public boolean getSecondaryIndexesEnabled()
- Specified by:
getSecondaryIndexesEnabled
in interfaceGuardrailsConfig
- Returns:
- Whether creation of secondary indexes is allowed.
-
setSecondaryIndexesEnabled
public void setSecondaryIndexesEnabled(boolean enabled)
-
getUncompressedTablesEnabled
public boolean getUncompressedTablesEnabled()
Description copied from interface:GuardrailsConfig
Returns whether tables can be uncompressed- Specified by:
getUncompressedTablesEnabled
in interfaceGuardrailsConfig
- Returns:
true
if user's can disable compression,false
otherwise.
-
setUncompressedTablesEnabled
public void setUncompressedTablesEnabled(boolean enabled)
-
getCompactTablesEnabled
public boolean getCompactTablesEnabled()
Description copied from interface:GuardrailsConfig
Returns whether users can create new COMPACT STORAGE tables- Specified by:
getCompactTablesEnabled
in interfaceGuardrailsConfig
- Returns:
true
if allowed,false
otherwise.
-
setCompactTablesEnabled
public void setCompactTablesEnabled(boolean enabled)
-
getAlterTableEnabled
public boolean getAlterTableEnabled()
Description copied from interface:GuardrailsConfig
Returns whether users are allowed access to the ALTER TABLE statement to mutate columns or not- Specified by:
getAlterTableEnabled
in interfaceGuardrailsConfig
- Returns:
true
if ALTER TABLE ADD/REMOVE/RENAME is allowed,false
otherwise.
-
setAlterTableEnabled
public void setAlterTableEnabled(boolean enabled)
-
getReadBeforeWriteListOperationsEnabled
public boolean getReadBeforeWriteListOperationsEnabled()
Description copied from interface:GuardrailsConfig
Returns whether list operations that require read before write are allowed.- Specified by:
getReadBeforeWriteListOperationsEnabled
in interfaceGuardrailsConfig
- Returns:
true
if list operations that require read before write are allowed,false
otherwise.
-
setReadBeforeWriteListOperationsEnabled
public void setReadBeforeWriteListOperationsEnabled(boolean enabled)
-
getAllowFilteringEnabled
public boolean getAllowFilteringEnabled()
Description copied from interface:GuardrailsConfig
Returns whether ALLOW FILTERING property is allowed.- Specified by:
getAllowFilteringEnabled
in interfaceGuardrailsConfig
- Returns:
true
if ALLOW FILTERING is allowed,false
otherwise.
-
setAllowFilteringEnabled
public void setAllowFilteringEnabled(boolean enabled)
-
getSimpleStrategyEnabled
public boolean getSimpleStrategyEnabled()
Description copied from interface:GuardrailsConfig
Returns whether setting SimpleStrategy via keyspace creation or alteration is enabled- Specified by:
getSimpleStrategyEnabled
in interfaceGuardrailsConfig
- Returns:
true
if SimpleStrategy is allowed,false
otherwise.
-
setSimpleStrategyEnabled
public void setSimpleStrategyEnabled(boolean enabled)
-
getInSelectCartesianProductWarnThreshold
public int getInSelectCartesianProductWarnThreshold()
- Specified by:
getInSelectCartesianProductWarnThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to warn when an IN query creates a cartesian product with a size exceeding threshold. -1 means disabled.
-
getInSelectCartesianProductFailThreshold
public int getInSelectCartesianProductFailThreshold()
- Specified by:
getInSelectCartesianProductFailThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to prevent IN queries creating a cartesian product with a size exceeding threshold. -1 means disabled.
-
setInSelectCartesianProductThreshold
public void setInSelectCartesianProductThreshold(int warn, int fail)
-
getReadConsistencyLevelsWarned
public java.util.Set<ConsistencyLevel> getReadConsistencyLevelsWarned()
- Specified by:
getReadConsistencyLevelsWarned
in interfaceGuardrailsConfig
- Returns:
- The consistency levels that are warned about when reading.
-
setReadConsistencyLevelsWarned
public void setReadConsistencyLevelsWarned(java.util.Set<ConsistencyLevel> consistencyLevels)
-
getReadConsistencyLevelsDisallowed
public java.util.Set<ConsistencyLevel> getReadConsistencyLevelsDisallowed()
- Specified by:
getReadConsistencyLevelsDisallowed
in interfaceGuardrailsConfig
- Returns:
- The consistency levels that are disallowed when reading.
-
setReadConsistencyLevelsDisallowed
public void setReadConsistencyLevelsDisallowed(java.util.Set<ConsistencyLevel> consistencyLevels)
-
getWriteConsistencyLevelsWarned
public java.util.Set<ConsistencyLevel> getWriteConsistencyLevelsWarned()
- Specified by:
getWriteConsistencyLevelsWarned
in interfaceGuardrailsConfig
- Returns:
- The consistency levels that are warned about when writing.
-
setWriteConsistencyLevelsWarned
public void setWriteConsistencyLevelsWarned(java.util.Set<ConsistencyLevel> consistencyLevels)
-
getWriteConsistencyLevelsDisallowed
public java.util.Set<ConsistencyLevel> getWriteConsistencyLevelsDisallowed()
- Specified by:
getWriteConsistencyLevelsDisallowed
in interfaceGuardrailsConfig
- Returns:
- The consistency levels that are disallowed when writing.
-
setWriteConsistencyLevelsDisallowed
public void setWriteConsistencyLevelsDisallowed(java.util.Set<ConsistencyLevel> consistencyLevels)
-
getPartitionSizeWarnThreshold
@Nullable public DataStorageSpec.LongBytesBound getPartitionSizeWarnThreshold()
- Specified by:
getPartitionSizeWarnThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to warn when writing partitions larger than threshold.
-
getPartitionSizeFailThreshold
@Nullable public DataStorageSpec.LongBytesBound getPartitionSizeFailThreshold()
- Specified by:
getPartitionSizeFailThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to fail when writing partitions larger than threshold.
-
setPartitionSizeThreshold
public void setPartitionSizeThreshold(@Nullable DataStorageSpec.LongBytesBound warn, @Nullable DataStorageSpec.LongBytesBound fail)
-
getPartitionTombstonesWarnThreshold
public long getPartitionTombstonesWarnThreshold()
- Specified by:
getPartitionTombstonesWarnThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to warn when writing partitions with more tombstones than threshold.
-
getPartitionTombstonesFailThreshold
public long getPartitionTombstonesFailThreshold()
- Specified by:
getPartitionTombstonesFailThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to fail when writing partitions with more tombstones than threshold.
-
setPartitionTombstonesThreshold
public void setPartitionTombstonesThreshold(long warn, long fail)
-
getColumnValueSizeWarnThreshold
@Nullable public DataStorageSpec.LongBytesBound getColumnValueSizeWarnThreshold()
- Specified by:
getColumnValueSizeWarnThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to warn when writing column values larger than threshold.
-
getColumnValueSizeFailThreshold
@Nullable public DataStorageSpec.LongBytesBound getColumnValueSizeFailThreshold()
- Specified by:
getColumnValueSizeFailThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to prevent writing column values larger than threshold.
-
setColumnValueSizeThreshold
public void setColumnValueSizeThreshold(@Nullable DataStorageSpec.LongBytesBound warn, @Nullable DataStorageSpec.LongBytesBound fail)
-
getCollectionSizeWarnThreshold
@Nullable public DataStorageSpec.LongBytesBound getCollectionSizeWarnThreshold()
- Specified by:
getCollectionSizeWarnThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to warn when encountering a collection with larger data size than threshold.
-
getCollectionSizeFailThreshold
@Nullable public DataStorageSpec.LongBytesBound getCollectionSizeFailThreshold()
- Specified by:
getCollectionSizeFailThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to prevent collections with larger data size than threshold.
-
setCollectionSizeThreshold
public void setCollectionSizeThreshold(@Nullable DataStorageSpec.LongBytesBound warn, @Nullable DataStorageSpec.LongBytesBound fail)
-
getItemsPerCollectionWarnThreshold
public int getItemsPerCollectionWarnThreshold()
- Specified by:
getItemsPerCollectionWarnThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to warn when encountering more elements in a collection than threshold.
-
getItemsPerCollectionFailThreshold
public int getItemsPerCollectionFailThreshold()
- Specified by:
getItemsPerCollectionFailThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to prevent collections with more elements than threshold.
-
setItemsPerCollectionThreshold
public void setItemsPerCollectionThreshold(int warn, int fail)
-
getFieldsPerUDTWarnThreshold
public int getFieldsPerUDTWarnThreshold()
- Specified by:
getFieldsPerUDTWarnThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to warn when creating a UDT with more fields than threshold.
-
getFieldsPerUDTFailThreshold
public int getFieldsPerUDTFailThreshold()
- Specified by:
getFieldsPerUDTFailThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to fail when creating a UDT with more fields than threshold.
-
setFieldsPerUDTThreshold
public void setFieldsPerUDTThreshold(int warn, int fail)
-
getVectorDimensionsWarnThreshold
public int getVectorDimensionsWarnThreshold()
- Specified by:
getVectorDimensionsWarnThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to warn when creating a vector with more dimensions than threshold.
-
getVectorDimensionsFailThreshold
public int getVectorDimensionsFailThreshold()
- Specified by:
getVectorDimensionsFailThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to fail when creating a vector with more dimensions than threshold.
-
setVectorDimensionsThreshold
public void setVectorDimensionsThreshold(int warn, int fail)
-
getDataDiskUsagePercentageWarnThreshold
public int getDataDiskUsagePercentageWarnThreshold()
- Specified by:
getDataDiskUsagePercentageWarnThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to warn when local disk usage percentage exceeds that threshold.
Allowed values are in the range
[1, 100]
, and -1 means disabled.
-
getDataDiskUsagePercentageFailThreshold
public int getDataDiskUsagePercentageFailThreshold()
- Specified by:
getDataDiskUsagePercentageFailThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to fail when local disk usage percentage exceeds that threshold.
Allowed values are in the range
[1, 100]
, and -1 means disabled.
-
setDataDiskUsagePercentageThreshold
public void setDataDiskUsagePercentageThreshold(int warn, int fail)
-
getDataDiskUsageMaxDiskSize
public DataStorageSpec.LongBytesBound getDataDiskUsageMaxDiskSize()
- Specified by:
getDataDiskUsageMaxDiskSize
in interfaceGuardrailsConfig
- Returns:
- The max disk size of the data directories when calculating disk usage thresholds,
null
means disabled.
-
setDataDiskUsageMaxDiskSize
public void setDataDiskUsageMaxDiskSize(@Nullable DataStorageSpec.LongBytesBound diskSize)
-
getMinimumReplicationFactorWarnThreshold
public int getMinimumReplicationFactorWarnThreshold()
- Specified by:
getMinimumReplicationFactorWarnThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to warn when replication factor is lesser than threshold.
-
getMinimumReplicationFactorFailThreshold
public int getMinimumReplicationFactorFailThreshold()
- Specified by:
getMinimumReplicationFactorFailThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to fail when replication factor is lesser than threshold.
-
setMinimumReplicationFactorThreshold
public void setMinimumReplicationFactorThreshold(int warn, int fail)
-
getMaximumReplicationFactorWarnThreshold
public int getMaximumReplicationFactorWarnThreshold()
- Specified by:
getMaximumReplicationFactorWarnThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to warn when replication factor is greater than threshold.
-
getMaximumReplicationFactorFailThreshold
public int getMaximumReplicationFactorFailThreshold()
- Specified by:
getMaximumReplicationFactorFailThreshold
in interfaceGuardrailsConfig
- Returns:
- The threshold to fail when replication factor is greater than threshold.
-
setMaximumReplicationFactorThreshold
public void setMaximumReplicationFactorThreshold(int warn, int fail)
-
getZeroTTLOnTWCSWarned
public boolean getZeroTTLOnTWCSWarned()
Description copied from interface:GuardrailsConfig
Returns whether warnings will be emitted when usage of 0 default TTL on a table with TimeWindowCompactionStrategy is detected.- Specified by:
getZeroTTLOnTWCSWarned
in interfaceGuardrailsConfig
- Returns:
true
if warnings will be emitted,false
otherwise.
-
setZeroTTLOnTWCSWarned
public void setZeroTTLOnTWCSWarned(boolean value)
Description copied from interface:GuardrailsConfig
Sets whether warnings will be emitted when usage of 0 default TTL on a table with TimeWindowCompactionStrategy is detected.- Specified by:
setZeroTTLOnTWCSWarned
in interfaceGuardrailsConfig
- Parameters:
value
-true
if warning will be emitted,false
otherwise.
-
getZeroTTLOnTWCSEnabled
public boolean getZeroTTLOnTWCSEnabled()
Description copied from interface:GuardrailsConfig
Returns whether it is allowed to create or alter table to use 0 default TTL with TimeWindowCompactionStrategy. If it is not, such query will fail.- Specified by:
getZeroTTLOnTWCSEnabled
in interfaceGuardrailsConfig
- Returns:
true
if 0 default TTL is allowed on TWCS table,false
otherwise.
-
setZeroTTLOnTWCSEnabled
public void setZeroTTLOnTWCSEnabled(boolean value)
Description copied from interface:GuardrailsConfig
Sets whether users can use 0 default TTL on a table with TimeWindowCompactionStrategy.- Specified by:
setZeroTTLOnTWCSEnabled
in interfaceGuardrailsConfig
- Parameters:
value
-true
if 0 default TTL on TWCS tables is allowed,false
otherwise.
-
getIntersectFilteringQueryWarned
public boolean getIntersectFilteringQueryWarned()
- Specified by:
getIntersectFilteringQueryWarned
in interfaceGuardrailsConfig
- Returns:
- true if a client warning is emitted for a filtering query with an intersection on mutable columns at a consistency level requiring coordinator reconciliation
-
setIntersectFilteringQueryWarned
public void setIntersectFilteringQueryWarned(boolean value)
- Specified by:
setIntersectFilteringQueryWarned
in interfaceGuardrailsConfig
-
getIntersectFilteringQueryEnabled
public boolean getIntersectFilteringQueryEnabled()
- Specified by:
getIntersectFilteringQueryEnabled
in interfaceGuardrailsConfig
- Returns:
- true if it is possible to execute a filtering query with an intersection on mutable columns at a consistency level requiring coordinator reconciliation
-
setIntersectFilteringQueryEnabled
public void setIntersectFilteringQueryEnabled(boolean value)
- Specified by:
setIntersectFilteringQueryEnabled
in interfaceGuardrailsConfig
-
getMaximumTimestampWarnThreshold
public DurationSpec.LongMicrosecondsBound getMaximumTimestampWarnThreshold()
- Specified by:
getMaximumTimestampWarnThreshold
in interfaceGuardrailsConfig
- Returns:
- A timestamp that if a user supplied timestamp is after will trigger a warning
-
getMaximumTimestampFailThreshold
public DurationSpec.LongMicrosecondsBound getMaximumTimestampFailThreshold()
- Specified by:
getMaximumTimestampFailThreshold
in interfaceGuardrailsConfig
- Returns:
- A timestamp that if a user supplied timestamp is after will cause a failure
-
setMaximumTimestampThreshold
public void setMaximumTimestampThreshold(@Nullable DurationSpec.LongMicrosecondsBound warn, @Nullable DurationSpec.LongMicrosecondsBound fail)
Description copied from interface:GuardrailsConfig
Sets the warning upper bound for user supplied timestamps- Specified by:
setMaximumTimestampThreshold
in interfaceGuardrailsConfig
- Parameters:
warn
- The highest acceptable difference between now and the written value timestamp before triggering a warning.null
means disabled.fail
- The highest acceptable difference between now and the written value timestamp before triggering a failure.null
means disabled.
-
getMinimumTimestampWarnThreshold
public DurationSpec.LongMicrosecondsBound getMinimumTimestampWarnThreshold()
- Specified by:
getMinimumTimestampWarnThreshold
in interfaceGuardrailsConfig
- Returns:
- A timestamp that if a user supplied timestamp is before will trigger a warning
-
getMinimumTimestampFailThreshold
public DurationSpec.LongMicrosecondsBound getMinimumTimestampFailThreshold()
- Specified by:
getMinimumTimestampFailThreshold
in interfaceGuardrailsConfig
- Returns:
- A timestamp that if a user supplied timestamp is after will trigger a warning
-
setMinimumTimestampThreshold
public void setMinimumTimestampThreshold(@Nullable DurationSpec.LongMicrosecondsBound warn, @Nullable DurationSpec.LongMicrosecondsBound fail)
Description copied from interface:GuardrailsConfig
Sets the warning lower bound for user supplied timestamps- Specified by:
setMinimumTimestampThreshold
in interfaceGuardrailsConfig
- Parameters:
warn
- The lowest acceptable difference between now and the written value timestamp before triggering a warning.null
means disabled.fail
- The lowest acceptable difference between now and the written value timestamp before triggering a failure.null
means disabled.
-
getSaiSSTableIndexesPerQueryWarnThreshold
public int getSaiSSTableIndexesPerQueryWarnThreshold()
- Specified by:
getSaiSSTableIndexesPerQueryWarnThreshold
in interfaceGuardrailsConfig
- Returns:
- the warning threshold for the number of SAI SSTable indexes searched by a query
-
getSaiSSTableIndexesPerQueryFailThreshold
public int getSaiSSTableIndexesPerQueryFailThreshold()
- Specified by:
getSaiSSTableIndexesPerQueryFailThreshold
in interfaceGuardrailsConfig
- Returns:
- the failure threshold for the number of SAI SSTable indexes searched by a query
-
setSaiSSTableIndexesPerQueryThreshold
public void setSaiSSTableIndexesPerQueryThreshold(int warn, int fail)
Description copied from interface:GuardrailsConfig
Sets warning and failure thresholds for the number of SAI SSTable indexes searched by a query- Specified by:
setSaiSSTableIndexesPerQueryThreshold
in interfaceGuardrailsConfig
- Parameters:
warn
- value to set for warn thresholdfail
- value to set for fail threshold
-
getSaiStringTermSizeWarnThreshold
@Nullable public DataStorageSpec.LongBytesBound getSaiStringTermSizeWarnThreshold()
- Specified by:
getSaiStringTermSizeWarnThreshold
in interfaceGuardrailsConfig
- Returns:
- the warning threshold for the size of string terms written to an SAI index
-
getSaiStringTermSizeFailThreshold
@Nullable public DataStorageSpec.LongBytesBound getSaiStringTermSizeFailThreshold()
- Specified by:
getSaiStringTermSizeFailThreshold
in interfaceGuardrailsConfig
- Returns:
- the failure threshold for the size of string terms written to an SAI index
-
setSaiStringTermSizeThreshold
public void setSaiStringTermSizeThreshold(@Nullable DataStorageSpec.LongBytesBound warn, @Nullable DataStorageSpec.LongBytesBound fail)
Description copied from interface:GuardrailsConfig
Sets warning and failure thresholds for the size of string terms written to an SAI index- Specified by:
setSaiStringTermSizeThreshold
in interfaceGuardrailsConfig
- Parameters:
warn
- value to set for warn thresholdfail
- value to set for fail threshold
-
getSaiFrozenTermSizeWarnThreshold
@Nullable public DataStorageSpec.LongBytesBound getSaiFrozenTermSizeWarnThreshold()
- Specified by:
getSaiFrozenTermSizeWarnThreshold
in interfaceGuardrailsConfig
- Returns:
- the warning threshold for the size of frozen terms written to an SAI index
-
getSaiFrozenTermSizeFailThreshold
@Nullable public DataStorageSpec.LongBytesBound getSaiFrozenTermSizeFailThreshold()
- Specified by:
getSaiFrozenTermSizeFailThreshold
in interfaceGuardrailsConfig
- Returns:
- the failure threshold for the size of frozen terms written to an SAI index
-
setSaiFrozenTermSizeThreshold
public void setSaiFrozenTermSizeThreshold(@Nullable DataStorageSpec.LongBytesBound warn, @Nullable DataStorageSpec.LongBytesBound fail)
Description copied from interface:GuardrailsConfig
Sets warning and failure thresholds for the size of frozen terms written to an SAI index- Specified by:
setSaiFrozenTermSizeThreshold
in interfaceGuardrailsConfig
- Parameters:
warn
- value to set for warn thresholdfail
- value to set for fail threshold
-
getSaiVectorTermSizeWarnThreshold
@Nullable public DataStorageSpec.LongBytesBound getSaiVectorTermSizeWarnThreshold()
- Specified by:
getSaiVectorTermSizeWarnThreshold
in interfaceGuardrailsConfig
- Returns:
- the warning threshold for the size of vector terms written to an SAI index
-
getSaiVectorTermSizeFailThreshold
@Nullable public DataStorageSpec.LongBytesBound getSaiVectorTermSizeFailThreshold()
- Specified by:
getSaiVectorTermSizeFailThreshold
in interfaceGuardrailsConfig
- Returns:
- the failure threshold for the size of vector terms written to an SAI index
-
setSaiVectorTermSizeThreshold
public void setSaiVectorTermSizeThreshold(@Nullable DataStorageSpec.LongBytesBound warn, @Nullable DataStorageSpec.LongBytesBound fail)
Description copied from interface:GuardrailsConfig
Sets warning and failure thresholds for the size of vector terms written to an SAI index- Specified by:
setSaiVectorTermSizeThreshold
in interfaceGuardrailsConfig
- Parameters:
warn
- value to set for warn thresholdfail
- value to set for fail threshold
-
getNonPartitionRestrictedQueryEnabled
public boolean getNonPartitionRestrictedQueryEnabled()
Description copied from interface:GuardrailsConfig
Returns whether it is possible to execute a query against secondary indexes without specifying any partition key restrictions.- Specified by:
getNonPartitionRestrictedQueryEnabled
in interfaceGuardrailsConfig
- Returns:
- true if it is possible to execute a query without a partition key, false otherwise
-
setNonPartitionRestrictedQueryEnabled
public void setNonPartitionRestrictedQueryEnabled(boolean enabled)
Description copied from interface:GuardrailsConfig
Sets whether it is possible to execute a query against indexes (secondary or SAI) without specifying any partition key restrictions.- Specified by:
setNonPartitionRestrictedQueryEnabled
in interfaceGuardrailsConfig
- Parameters:
enabled
-true
if a query without partition key is enabled or not
-
getVectorTypeEnabled
public boolean getVectorTypeEnabled()
- Specified by:
getVectorTypeEnabled
in interfaceGuardrailsConfig
- Returns:
- Whether new columns can be created with vector type
-
setVectorTypeEnabled
public void setVectorTypeEnabled(boolean enabled)
Description copied from interface:GuardrailsConfig
Sets whether new columns can be created with vector type- Specified by:
setVectorTypeEnabled
in interfaceGuardrailsConfig
-
validateTimestampThreshold
public static void validateTimestampThreshold(DurationSpec.LongMicrosecondsBound warn, DurationSpec.LongMicrosecondsBound fail, java.lang.String name)
-
-