Package org.apache.cassandra.config
Class GuardrailsOptions
java.lang.Object
org.apache.cassandra.config.GuardrailsOptions
- All Implemented Interfaces:
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 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether ALLOW FILTERING property is allowed.booleanReturns whether users are allowed access to the ALTER TABLE statement to mutate columns or notintintbooleanReturns whether users can create new COMPACT STORAGE tablesintintbooleanReturns whether DROP on keyspaces is allowedbooleanReturns whether TRUNCATE or DROP table are allowedintintbooleanReturns whether GROUP BY functionality is allowedintintbooleanbooleanintintintintintintintintintintbooleanReturns whether it is possible to execute a query against secondary indexes without specifying any partition key restrictions.intintintintlonglongbooleanReturns whether list operations that require read before write are allowed.intintbooleanintintbooleanReturns whether setting SimpleStrategy via keyspace creation or alteration is enabledintintbooleanReturns whether tables can be uncompressedbooleanReturns whether user-provided timestamps are allowed.intintbooleanbooleanReturns whether it is allowed to create or alter table to use 0 default TTL with TimeWindowCompactionStrategy.booleanReturns whether warnings will be emitted when usage of 0 default TTL on a table with TimeWindowCompactionStrategy is detected.voidsetAllowFilteringEnabled(boolean enabled) voidsetAlterTableEnabled(boolean enabled) voidsetCollectionSizeThreshold(DataStorageSpec.LongBytesBound warn, DataStorageSpec.LongBytesBound fail) voidsetColumnsPerTableThreshold(int warn, int fail) voidsetColumnValueSizeThreshold(DataStorageSpec.LongBytesBound warn, DataStorageSpec.LongBytesBound fail) voidsetCompactTablesEnabled(boolean enabled) voidvoidsetDataDiskUsagePercentageThreshold(int warn, int fail) voidsetDropKeyspaceEnabled(boolean enabled) voidsetDropTruncateTableEnabled(boolean enabled) voidsetFieldsPerUDTThreshold(int warn, int fail) voidsetGroupByEnabled(boolean enabled) voidsetInSelectCartesianProductThreshold(int warn, int fail) voidsetIntersectFilteringQueryEnabled(boolean value) voidsetIntersectFilteringQueryWarned(boolean value) voidsetItemsPerCollectionThreshold(int warn, int fail) voidsetKeyspacesThreshold(int warn, int fail) voidsetMaterializedViewsPerTableThreshold(int warn, int fail) voidsetMaximumReplicationFactorThreshold(int warn, int fail) voidsetMaximumTimestampThreshold(DurationSpec.LongMicrosecondsBound warn, DurationSpec.LongMicrosecondsBound fail) Sets the warning upper bound for user supplied timestampsvoidsetMinimumReplicationFactorThreshold(int warn, int fail) voidsetMinimumTimestampThreshold(DurationSpec.LongMicrosecondsBound warn, DurationSpec.LongMicrosecondsBound fail) Sets the warning lower bound for user supplied timestampsvoidsetNonPartitionRestrictedQueryEnabled(boolean enabled) Sets whether it is possible to execute a query against indexes (secondary or SAI) without specifying any partition key restrictions.voidsetPageSizeThreshold(int warn, int fail) voidsetPartitionKeysInSelectThreshold(int warn, int fail) voidvoidsetPartitionTombstonesThreshold(long warn, long fail) voidsetReadBeforeWriteListOperationsEnabled(boolean enabled) voidsetReadConsistencyLevelsDisallowed(Set<ConsistencyLevel> consistencyLevels) voidsetReadConsistencyLevelsWarned(Set<ConsistencyLevel> consistencyLevels) voidsetSaiFrozenTermSizeThreshold(DataStorageSpec.LongBytesBound warn, DataStorageSpec.LongBytesBound fail) Sets warning and failure thresholds for the size of frozen terms written to an SAI indexvoidsetSaiSSTableIndexesPerQueryThreshold(int warn, int fail) Sets warning and failure thresholds for the number of SAI SSTable indexes searched by a queryvoidsetSaiStringTermSizeThreshold(DataStorageSpec.LongBytesBound warn, DataStorageSpec.LongBytesBound fail) Sets warning and failure thresholds for the size of string terms written to an SAI indexvoidsetSaiVectorTermSizeThreshold(DataStorageSpec.LongBytesBound warn, DataStorageSpec.LongBytesBound fail) Sets warning and failure thresholds for the size of vector terms written to an SAI indexvoidsetSecondaryIndexesEnabled(boolean enabled) voidsetSecondaryIndexesPerTableThreshold(int warn, int fail) voidsetSimpleStrategyEnabled(boolean enabled) voidsetTablePropertiesDisallowed(Set<String> properties) voidsetTablePropertiesIgnored(Set<String> properties) voidsetTablePropertiesWarned(Set<String> properties) voidsetTablesThreshold(int warn, int fail) voidsetUncompressedTablesEnabled(boolean enabled) voidsetUserTimestampsEnabled(boolean enabled) voidsetVectorDimensionsThreshold(int warn, int fail) voidsetVectorTypeEnabled(boolean enabled) Sets whether new columns can be created with vector typevoidsetWriteConsistencyLevelsDisallowed(Set<ConsistencyLevel> consistencyLevels) voidsetWriteConsistencyLevelsWarned(Set<ConsistencyLevel> consistencyLevels) voidsetZeroTTLOnTWCSEnabled(boolean value) Sets whether users can use 0 default TTL on a table with TimeWindowCompactionStrategy.voidsetZeroTTLOnTWCSWarned(boolean value) Sets whether warnings will be emitted when usage of 0 default TTL on a table with TimeWindowCompactionStrategy is detected.static voidvalidateTimestampThreshold(DurationSpec.LongMicrosecondsBound warn, DurationSpec.LongMicrosecondsBound fail, String name)
-
Constructor Details
-
GuardrailsOptions
-
-
Method Details
-
getKeyspacesWarnThreshold
public int getKeyspacesWarnThreshold()- Specified by:
getKeyspacesWarnThresholdin interfaceGuardrailsConfig- Returns:
- The threshold to warn when creating more user keyspaces than threshold.
-
getKeyspacesFailThreshold
public int getKeyspacesFailThreshold()- Specified by:
getKeyspacesFailThresholdin 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:
getTablesWarnThresholdin interfaceGuardrailsConfig- Returns:
- The threshold to warn when creating more user tables than threshold.
-
getTablesFailThreshold
public int getTablesFailThreshold()- Specified by:
getTablesFailThresholdin 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:
getColumnsPerTableWarnThresholdin interfaceGuardrailsConfig- Returns:
- The threshold to warn when creating more columns per table than threshold.
-
getColumnsPerTableFailThreshold
public int getColumnsPerTableFailThreshold()- Specified by:
getColumnsPerTableFailThresholdin 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:
getSecondaryIndexesPerTableWarnThresholdin interfaceGuardrailsConfig- Returns:
- The threshold to warn when creating more secondary indexes per table than threshold.
-
getSecondaryIndexesPerTableFailThreshold
public int getSecondaryIndexesPerTableFailThreshold()- Specified by:
getSecondaryIndexesPerTableFailThresholdin 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:
getMaterializedViewsPerTableWarnThresholdin interfaceGuardrailsConfig- Returns:
- The threshold to warn when creating more materialized views per table than threshold.
-
getPartitionKeysInSelectWarnThreshold
public int getPartitionKeysInSelectWarnThreshold()- Specified by:
getPartitionKeysInSelectWarnThresholdin interfaceGuardrailsConfig- Returns:
- The threshold to warn when partition keys in select more than threshold.
-
getPartitionKeysInSelectFailThreshold
public int getPartitionKeysInSelectFailThreshold()- Specified by:
getPartitionKeysInSelectFailThresholdin 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:
getMaterializedViewsPerTableFailThresholdin 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:
getPageSizeWarnThresholdin interfaceGuardrailsConfig- Returns:
- The threshold to warn when page size exceeds given size.
-
getPageSizeFailThreshold
public int getPageSizeFailThreshold()- Specified by:
getPageSizeFailThresholdin interfaceGuardrailsConfig- Returns:
- The threshold to fail when page size exceeds given size.
-
setPageSizeThreshold
public void setPageSizeThreshold(int warn, int fail) -
getTablePropertiesWarned
- Specified by:
getTablePropertiesWarnedin interfaceGuardrailsConfig- Returns:
- The table properties that are warned about when creating or altering a table.
-
setTablePropertiesWarned
-
getTablePropertiesIgnored
- Specified by:
getTablePropertiesIgnoredin interfaceGuardrailsConfig- Returns:
- The table properties that are ignored when creating or altering a table.
-
setTablePropertiesIgnored
-
getTablePropertiesDisallowed
- Specified by:
getTablePropertiesDisallowedin interfaceGuardrailsConfig- Returns:
- The table properties that are disallowed when creating or altering a table.
-
setTablePropertiesDisallowed
-
getUserTimestampsEnabled
public boolean getUserTimestampsEnabled()Description copied from interface:GuardrailsConfigReturns whether user-provided timestamps are allowed.- Specified by:
getUserTimestampsEnabledin interfaceGuardrailsConfig- Returns:
trueif user-provided timestamps are allowed,falseotherwise.
-
setUserTimestampsEnabled
public void setUserTimestampsEnabled(boolean enabled) -
getGroupByEnabled
public boolean getGroupByEnabled()Description copied from interface:GuardrailsConfigReturns whether GROUP BY functionality is allowed- Specified by:
getGroupByEnabledin interfaceGuardrailsConfig- Returns:
trueif allowed,falseotherwise.
-
setGroupByEnabled
public void setGroupByEnabled(boolean enabled) -
getDropTruncateTableEnabled
public boolean getDropTruncateTableEnabled()Description copied from interface:GuardrailsConfigReturns whether TRUNCATE or DROP table are allowed- Specified by:
getDropTruncateTableEnabledin interfaceGuardrailsConfig- Returns:
trueif allowed,falseotherwise.
-
setDropTruncateTableEnabled
public void setDropTruncateTableEnabled(boolean enabled) -
getDropKeyspaceEnabled
public boolean getDropKeyspaceEnabled()Description copied from interface:GuardrailsConfigReturns whether DROP on keyspaces is allowed- Specified by:
getDropKeyspaceEnabledin interfaceGuardrailsConfig- Returns:
trueif allowed,falseotherwise.
-
setDropKeyspaceEnabled
public void setDropKeyspaceEnabled(boolean enabled) -
getSecondaryIndexesEnabled
public boolean getSecondaryIndexesEnabled()- Specified by:
getSecondaryIndexesEnabledin interfaceGuardrailsConfig- Returns:
- Whether creation of secondary indexes is allowed.
-
setSecondaryIndexesEnabled
public void setSecondaryIndexesEnabled(boolean enabled) -
getUncompressedTablesEnabled
public boolean getUncompressedTablesEnabled()Description copied from interface:GuardrailsConfigReturns whether tables can be uncompressed- Specified by:
getUncompressedTablesEnabledin interfaceGuardrailsConfig- Returns:
trueif user's can disable compression,falseotherwise.
-
setUncompressedTablesEnabled
public void setUncompressedTablesEnabled(boolean enabled) -
getCompactTablesEnabled
public boolean getCompactTablesEnabled()Description copied from interface:GuardrailsConfigReturns whether users can create new COMPACT STORAGE tables- Specified by:
getCompactTablesEnabledin interfaceGuardrailsConfig- Returns:
trueif allowed,falseotherwise.
-
setCompactTablesEnabled
public void setCompactTablesEnabled(boolean enabled) -
getAlterTableEnabled
public boolean getAlterTableEnabled()Description copied from interface:GuardrailsConfigReturns whether users are allowed access to the ALTER TABLE statement to mutate columns or not- Specified by:
getAlterTableEnabledin interfaceGuardrailsConfig- Returns:
trueif ALTER TABLE ADD/REMOVE/RENAME is allowed,falseotherwise.
-
setAlterTableEnabled
public void setAlterTableEnabled(boolean enabled) -
getReadBeforeWriteListOperationsEnabled
public boolean getReadBeforeWriteListOperationsEnabled()Description copied from interface:GuardrailsConfigReturns whether list operations that require read before write are allowed.- Specified by:
getReadBeforeWriteListOperationsEnabledin interfaceGuardrailsConfig- Returns:
trueif list operations that require read before write are allowed,falseotherwise.
-
setReadBeforeWriteListOperationsEnabled
public void setReadBeforeWriteListOperationsEnabled(boolean enabled) -
getAllowFilteringEnabled
public boolean getAllowFilteringEnabled()Description copied from interface:GuardrailsConfigReturns whether ALLOW FILTERING property is allowed.- Specified by:
getAllowFilteringEnabledin interfaceGuardrailsConfig- Returns:
trueif ALLOW FILTERING is allowed,falseotherwise.
-
setAllowFilteringEnabled
public void setAllowFilteringEnabled(boolean enabled) -
getSimpleStrategyEnabled
public boolean getSimpleStrategyEnabled()Description copied from interface:GuardrailsConfigReturns whether setting SimpleStrategy via keyspace creation or alteration is enabled- Specified by:
getSimpleStrategyEnabledin interfaceGuardrailsConfig- Returns:
trueif SimpleStrategy is allowed,falseotherwise.
-
setSimpleStrategyEnabled
public void setSimpleStrategyEnabled(boolean enabled) -
getInSelectCartesianProductWarnThreshold
public int getInSelectCartesianProductWarnThreshold()- Specified by:
getInSelectCartesianProductWarnThresholdin 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:
getInSelectCartesianProductFailThresholdin 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
- Specified by:
getReadConsistencyLevelsWarnedin interfaceGuardrailsConfig- Returns:
- The consistency levels that are warned about when reading.
-
setReadConsistencyLevelsWarned
-
getReadConsistencyLevelsDisallowed
- Specified by:
getReadConsistencyLevelsDisallowedin interfaceGuardrailsConfig- Returns:
- The consistency levels that are disallowed when reading.
-
setReadConsistencyLevelsDisallowed
-
getWriteConsistencyLevelsWarned
- Specified by:
getWriteConsistencyLevelsWarnedin interfaceGuardrailsConfig- Returns:
- The consistency levels that are warned about when writing.
-
setWriteConsistencyLevelsWarned
-
getWriteConsistencyLevelsDisallowed
- Specified by:
getWriteConsistencyLevelsDisallowedin interfaceGuardrailsConfig- Returns:
- The consistency levels that are disallowed when writing.
-
setWriteConsistencyLevelsDisallowed
-
getPartitionSizeWarnThreshold
- Specified by:
getPartitionSizeWarnThresholdin interfaceGuardrailsConfig- Returns:
- The threshold to warn when writing partitions larger than threshold.
-
getPartitionSizeFailThreshold
- Specified by:
getPartitionSizeFailThresholdin 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:
getPartitionTombstonesWarnThresholdin interfaceGuardrailsConfig- Returns:
- The threshold to warn when writing partitions with more tombstones than threshold.
-
getPartitionTombstonesFailThreshold
public long getPartitionTombstonesFailThreshold()- Specified by:
getPartitionTombstonesFailThresholdin interfaceGuardrailsConfig- Returns:
- The threshold to fail when writing partitions with more tombstones than threshold.
-
setPartitionTombstonesThreshold
public void setPartitionTombstonesThreshold(long warn, long fail) -
getColumnValueSizeWarnThreshold
- Specified by:
getColumnValueSizeWarnThresholdin interfaceGuardrailsConfig- Returns:
- The threshold to warn when writing column values larger than threshold.
-
getColumnValueSizeFailThreshold
- Specified by:
getColumnValueSizeFailThresholdin 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
- Specified by:
getCollectionSizeWarnThresholdin interfaceGuardrailsConfig- Returns:
- The threshold to warn when encountering a collection with larger data size than threshold.
-
getCollectionSizeFailThreshold
- Specified by:
getCollectionSizeFailThresholdin 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:
getItemsPerCollectionWarnThresholdin interfaceGuardrailsConfig- Returns:
- The threshold to warn when encountering more elements in a collection than threshold.
-
getItemsPerCollectionFailThreshold
public int getItemsPerCollectionFailThreshold()- Specified by:
getItemsPerCollectionFailThresholdin 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:
getFieldsPerUDTWarnThresholdin interfaceGuardrailsConfig- Returns:
- The threshold to warn when creating a UDT with more fields than threshold.
-
getFieldsPerUDTFailThreshold
public int getFieldsPerUDTFailThreshold()- Specified by:
getFieldsPerUDTFailThresholdin 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:
getVectorDimensionsWarnThresholdin interfaceGuardrailsConfig- Returns:
- The threshold to warn when creating a vector with more dimensions than threshold.
-
getVectorDimensionsFailThreshold
public int getVectorDimensionsFailThreshold()- Specified by:
getVectorDimensionsFailThresholdin 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:
getDataDiskUsagePercentageWarnThresholdin 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:
getDataDiskUsagePercentageFailThresholdin 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
- Specified by:
getDataDiskUsageMaxDiskSizein interfaceGuardrailsConfig- Returns:
- The max disk size of the data directories when calculating disk usage thresholds,
nullmeans disabled.
-
setDataDiskUsageMaxDiskSize
-
getMinimumReplicationFactorWarnThreshold
public int getMinimumReplicationFactorWarnThreshold()- Specified by:
getMinimumReplicationFactorWarnThresholdin interfaceGuardrailsConfig- Returns:
- The threshold to warn when replication factor is lesser than threshold.
-
getMinimumReplicationFactorFailThreshold
public int getMinimumReplicationFactorFailThreshold()- Specified by:
getMinimumReplicationFactorFailThresholdin 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:
getMaximumReplicationFactorWarnThresholdin interfaceGuardrailsConfig- Returns:
- The threshold to warn when replication factor is greater than threshold.
-
getMaximumReplicationFactorFailThreshold
public int getMaximumReplicationFactorFailThreshold()- Specified by:
getMaximumReplicationFactorFailThresholdin 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:GuardrailsConfigReturns whether warnings will be emitted when usage of 0 default TTL on a table with TimeWindowCompactionStrategy is detected.- Specified by:
getZeroTTLOnTWCSWarnedin interfaceGuardrailsConfig- Returns:
trueif warnings will be emitted,falseotherwise.
-
setZeroTTLOnTWCSWarned
public void setZeroTTLOnTWCSWarned(boolean value) Description copied from interface:GuardrailsConfigSets whether warnings will be emitted when usage of 0 default TTL on a table with TimeWindowCompactionStrategy is detected.- Specified by:
setZeroTTLOnTWCSWarnedin interfaceGuardrailsConfig- Parameters:
value-trueif warning will be emitted,falseotherwise.
-
getZeroTTLOnTWCSEnabled
public boolean getZeroTTLOnTWCSEnabled()Description copied from interface:GuardrailsConfigReturns 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:
getZeroTTLOnTWCSEnabledin interfaceGuardrailsConfig- Returns:
trueif 0 default TTL is allowed on TWCS table,falseotherwise.
-
setZeroTTLOnTWCSEnabled
public void setZeroTTLOnTWCSEnabled(boolean value) Description copied from interface:GuardrailsConfigSets whether users can use 0 default TTL on a table with TimeWindowCompactionStrategy.- Specified by:
setZeroTTLOnTWCSEnabledin interfaceGuardrailsConfig- Parameters:
value-trueif 0 default TTL on TWCS tables is allowed,falseotherwise.
-
getIntersectFilteringQueryWarned
public boolean getIntersectFilteringQueryWarned()- Specified by:
getIntersectFilteringQueryWarnedin 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:
setIntersectFilteringQueryWarnedin interfaceGuardrailsConfig
-
getIntersectFilteringQueryEnabled
public boolean getIntersectFilteringQueryEnabled()- Specified by:
getIntersectFilteringQueryEnabledin 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:
setIntersectFilteringQueryEnabledin interfaceGuardrailsConfig
-
getMaximumTimestampWarnThreshold
- Specified by:
getMaximumTimestampWarnThresholdin interfaceGuardrailsConfig- Returns:
- A timestamp that if a user supplied timestamp is after will trigger a warning
-
getMaximumTimestampFailThreshold
- Specified by:
getMaximumTimestampFailThresholdin 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:GuardrailsConfigSets the warning upper bound for user supplied timestamps- Specified by:
setMaximumTimestampThresholdin interfaceGuardrailsConfig- Parameters:
warn- The highest acceptable difference between now and the written value timestamp before triggering a warning.nullmeans disabled.fail- The highest acceptable difference between now and the written value timestamp before triggering a failure.nullmeans disabled.
-
getMinimumTimestampWarnThreshold
- Specified by:
getMinimumTimestampWarnThresholdin interfaceGuardrailsConfig- Returns:
- A timestamp that if a user supplied timestamp is before will trigger a warning
-
getMinimumTimestampFailThreshold
- Specified by:
getMinimumTimestampFailThresholdin 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:GuardrailsConfigSets the warning lower bound for user supplied timestamps- Specified by:
setMinimumTimestampThresholdin interfaceGuardrailsConfig- Parameters:
warn- The lowest acceptable difference between now and the written value timestamp before triggering a warning.nullmeans disabled.fail- The lowest acceptable difference between now and the written value timestamp before triggering a failure.nullmeans disabled.
-
getSaiSSTableIndexesPerQueryWarnThreshold
public int getSaiSSTableIndexesPerQueryWarnThreshold()- Specified by:
getSaiSSTableIndexesPerQueryWarnThresholdin interfaceGuardrailsConfig- Returns:
- the warning threshold for the number of SAI SSTable indexes searched by a query
-
getSaiSSTableIndexesPerQueryFailThreshold
public int getSaiSSTableIndexesPerQueryFailThreshold()- Specified by:
getSaiSSTableIndexesPerQueryFailThresholdin 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:GuardrailsConfigSets warning and failure thresholds for the number of SAI SSTable indexes searched by a query- Specified by:
setSaiSSTableIndexesPerQueryThresholdin interfaceGuardrailsConfig- Parameters:
warn- value to set for warn thresholdfail- value to set for fail threshold
-
getSaiStringTermSizeWarnThreshold
- Specified by:
getSaiStringTermSizeWarnThresholdin interfaceGuardrailsConfig- Returns:
- the warning threshold for the size of string terms written to an SAI index
-
getSaiStringTermSizeFailThreshold
- Specified by:
getSaiStringTermSizeFailThresholdin 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:GuardrailsConfigSets warning and failure thresholds for the size of string terms written to an SAI index- Specified by:
setSaiStringTermSizeThresholdin interfaceGuardrailsConfig- Parameters:
warn- value to set for warn thresholdfail- value to set for fail threshold
-
getSaiFrozenTermSizeWarnThreshold
- Specified by:
getSaiFrozenTermSizeWarnThresholdin interfaceGuardrailsConfig- Returns:
- the warning threshold for the size of frozen terms written to an SAI index
-
getSaiFrozenTermSizeFailThreshold
- Specified by:
getSaiFrozenTermSizeFailThresholdin 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:GuardrailsConfigSets warning and failure thresholds for the size of frozen terms written to an SAI index- Specified by:
setSaiFrozenTermSizeThresholdin interfaceGuardrailsConfig- Parameters:
warn- value to set for warn thresholdfail- value to set for fail threshold
-
getSaiVectorTermSizeWarnThreshold
- Specified by:
getSaiVectorTermSizeWarnThresholdin interfaceGuardrailsConfig- Returns:
- the warning threshold for the size of vector terms written to an SAI index
-
getSaiVectorTermSizeFailThreshold
- Specified by:
getSaiVectorTermSizeFailThresholdin 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:GuardrailsConfigSets warning and failure thresholds for the size of vector terms written to an SAI index- Specified by:
setSaiVectorTermSizeThresholdin interfaceGuardrailsConfig- Parameters:
warn- value to set for warn thresholdfail- value to set for fail threshold
-
getNonPartitionRestrictedQueryEnabled
public boolean getNonPartitionRestrictedQueryEnabled()Description copied from interface:GuardrailsConfigReturns whether it is possible to execute a query against secondary indexes without specifying any partition key restrictions.- Specified by:
getNonPartitionRestrictedQueryEnabledin 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:GuardrailsConfigSets whether it is possible to execute a query against indexes (secondary or SAI) without specifying any partition key restrictions.- Specified by:
setNonPartitionRestrictedQueryEnabledin interfaceGuardrailsConfig- Parameters:
enabled-trueif a query without partition key is enabled or not
-
getVectorTypeEnabled
public boolean getVectorTypeEnabled()- Specified by:
getVectorTypeEnabledin interfaceGuardrailsConfig- Returns:
- Whether new columns can be created with vector type
-
setVectorTypeEnabled
public void setVectorTypeEnabled(boolean enabled) Description copied from interface:GuardrailsConfigSets whether new columns can be created with vector type- Specified by:
setVectorTypeEnabledin interfaceGuardrailsConfig
-
validateTimestampThreshold
public static void validateTimestampThreshold(DurationSpec.LongMicrosecondsBound warn, DurationSpec.LongMicrosecondsBound fail, String name)
-