Class GuardrailsOptions

java.lang.Object
org.apache.cassandra.config.GuardrailsOptions
All Implemented Interfaces:
GuardrailsConfig

public class GuardrailsOptions extends 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 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 Details

    • GuardrailsOptions

      public GuardrailsOptions(Config config)
  • Method Details

    • getKeyspacesWarnThreshold

      public int getKeyspacesWarnThreshold()
      Specified by:
      getKeyspacesWarnThreshold in interface GuardrailsConfig
      Returns:
      The threshold to warn when creating more user keyspaces than threshold.
    • getKeyspacesFailThreshold

      public int getKeyspacesFailThreshold()
      Specified by:
      getKeyspacesFailThreshold in interface GuardrailsConfig
      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 interface GuardrailsConfig
      Returns:
      The threshold to warn when creating more user tables than threshold.
    • getTablesFailThreshold

      public int getTablesFailThreshold()
      Specified by:
      getTablesFailThreshold in interface GuardrailsConfig
      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 interface GuardrailsConfig
      Returns:
      The threshold to warn when creating more columns per table than threshold.
    • getColumnsPerTableFailThreshold

      public int getColumnsPerTableFailThreshold()
      Specified by:
      getColumnsPerTableFailThreshold in interface GuardrailsConfig
      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 interface GuardrailsConfig
      Returns:
      The threshold to warn when creating more secondary indexes per table than threshold.
    • getSecondaryIndexesPerTableFailThreshold

      public int getSecondaryIndexesPerTableFailThreshold()
      Specified by:
      getSecondaryIndexesPerTableFailThreshold in interface GuardrailsConfig
      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 interface GuardrailsConfig
      Returns:
      The threshold to warn when creating more materialized views per table than threshold.
    • getPartitionKeysInSelectWarnThreshold

      public int getPartitionKeysInSelectWarnThreshold()
      Specified by:
      getPartitionKeysInSelectWarnThreshold in interface GuardrailsConfig
      Returns:
      The threshold to warn when partition keys in select more than threshold.
    • getPartitionKeysInSelectFailThreshold

      public int getPartitionKeysInSelectFailThreshold()
      Specified by:
      getPartitionKeysInSelectFailThreshold in interface GuardrailsConfig
      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 interface GuardrailsConfig
      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 interface GuardrailsConfig
      Returns:
      The threshold to warn when page size exceeds given size.
    • getPageSizeFailThreshold

      public int getPageSizeFailThreshold()
      Specified by:
      getPageSizeFailThreshold in interface GuardrailsConfig
      Returns:
      The threshold to fail when page size exceeds given size.
    • setPageSizeThreshold

      public void setPageSizeThreshold(int warn, int fail)
    • getTablePropertiesWarned

      public Set<String> getTablePropertiesWarned()
      Specified by:
      getTablePropertiesWarned in interface GuardrailsConfig
      Returns:
      The table properties that are warned about when creating or altering a table.
    • setTablePropertiesWarned

      public void setTablePropertiesWarned(Set<String> properties)
    • getTablePropertiesIgnored

      public Set<String> getTablePropertiesIgnored()
      Specified by:
      getTablePropertiesIgnored in interface GuardrailsConfig
      Returns:
      The table properties that are ignored when creating or altering a table.
    • setTablePropertiesIgnored

      public void setTablePropertiesIgnored(Set<String> properties)
    • getTablePropertiesDisallowed

      public Set<String> getTablePropertiesDisallowed()
      Specified by:
      getTablePropertiesDisallowed in interface GuardrailsConfig
      Returns:
      The table properties that are disallowed when creating or altering a table.
    • setTablePropertiesDisallowed

      public void setTablePropertiesDisallowed(Set<String> properties)
    • getUserTimestampsEnabled

      public boolean getUserTimestampsEnabled()
      Description copied from interface: GuardrailsConfig
      Returns whether user-provided timestamps are allowed.
      Specified by:
      getUserTimestampsEnabled in interface GuardrailsConfig
      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 interface GuardrailsConfig
      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 interface GuardrailsConfig
      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 interface GuardrailsConfig
      Returns:
      true if allowed, false otherwise.
    • setDropKeyspaceEnabled

      public void setDropKeyspaceEnabled(boolean enabled)
    • getSecondaryIndexesEnabled

      public boolean getSecondaryIndexesEnabled()
      Specified by:
      getSecondaryIndexesEnabled in interface GuardrailsConfig
      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 interface GuardrailsConfig
      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 interface GuardrailsConfig
      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 interface GuardrailsConfig
      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 interface GuardrailsConfig
      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 interface GuardrailsConfig
      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 interface GuardrailsConfig
      Returns:
      true if SimpleStrategy is allowed, false otherwise.
    • setSimpleStrategyEnabled

      public void setSimpleStrategyEnabled(boolean enabled)
    • getInSelectCartesianProductWarnThreshold

      public int getInSelectCartesianProductWarnThreshold()
      Specified by:
      getInSelectCartesianProductWarnThreshold in interface GuardrailsConfig
      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 interface GuardrailsConfig
      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 Set<ConsistencyLevel> getReadConsistencyLevelsWarned()
      Specified by:
      getReadConsistencyLevelsWarned in interface GuardrailsConfig
      Returns:
      The consistency levels that are warned about when reading.
    • setReadConsistencyLevelsWarned

      public void setReadConsistencyLevelsWarned(Set<ConsistencyLevel> consistencyLevels)
    • getReadConsistencyLevelsDisallowed

      public Set<ConsistencyLevel> getReadConsistencyLevelsDisallowed()
      Specified by:
      getReadConsistencyLevelsDisallowed in interface GuardrailsConfig
      Returns:
      The consistency levels that are disallowed when reading.
    • setReadConsistencyLevelsDisallowed

      public void setReadConsistencyLevelsDisallowed(Set<ConsistencyLevel> consistencyLevels)
    • getWriteConsistencyLevelsWarned

      public Set<ConsistencyLevel> getWriteConsistencyLevelsWarned()
      Specified by:
      getWriteConsistencyLevelsWarned in interface GuardrailsConfig
      Returns:
      The consistency levels that are warned about when writing.
    • setWriteConsistencyLevelsWarned

      public void setWriteConsistencyLevelsWarned(Set<ConsistencyLevel> consistencyLevels)
    • getWriteConsistencyLevelsDisallowed

      public Set<ConsistencyLevel> getWriteConsistencyLevelsDisallowed()
      Specified by:
      getWriteConsistencyLevelsDisallowed in interface GuardrailsConfig
      Returns:
      The consistency levels that are disallowed when writing.
    • setWriteConsistencyLevelsDisallowed

      public void setWriteConsistencyLevelsDisallowed(Set<ConsistencyLevel> consistencyLevels)
    • getPartitionSizeWarnThreshold

      @Nullable public DataStorageSpec.LongBytesBound getPartitionSizeWarnThreshold()
      Specified by:
      getPartitionSizeWarnThreshold in interface GuardrailsConfig
      Returns:
      The threshold to warn when writing partitions larger than threshold.
    • getPartitionSizeFailThreshold

      @Nullable public DataStorageSpec.LongBytesBound getPartitionSizeFailThreshold()
      Specified by:
      getPartitionSizeFailThreshold in interface GuardrailsConfig
      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 interface GuardrailsConfig
      Returns:
      The threshold to warn when writing partitions with more tombstones than threshold.
    • getPartitionTombstonesFailThreshold

      public long getPartitionTombstonesFailThreshold()
      Specified by:
      getPartitionTombstonesFailThreshold in interface GuardrailsConfig
      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 interface GuardrailsConfig
      Returns:
      The threshold to warn when writing column values larger than threshold.
    • getColumnValueSizeFailThreshold

      @Nullable public DataStorageSpec.LongBytesBound getColumnValueSizeFailThreshold()
      Specified by:
      getColumnValueSizeFailThreshold in interface GuardrailsConfig
      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 interface GuardrailsConfig
      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 interface GuardrailsConfig
      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 interface GuardrailsConfig
      Returns:
      The threshold to warn when encountering more elements in a collection than threshold.
    • getItemsPerCollectionFailThreshold

      public int getItemsPerCollectionFailThreshold()
      Specified by:
      getItemsPerCollectionFailThreshold in interface GuardrailsConfig
      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 interface GuardrailsConfig
      Returns:
      The threshold to warn when creating a UDT with more fields than threshold.
    • getFieldsPerUDTFailThreshold

      public int getFieldsPerUDTFailThreshold()
      Specified by:
      getFieldsPerUDTFailThreshold in interface GuardrailsConfig
      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 interface GuardrailsConfig
      Returns:
      The threshold to warn when creating a vector with more dimensions than threshold.
    • getVectorDimensionsFailThreshold

      public int getVectorDimensionsFailThreshold()
      Specified by:
      getVectorDimensionsFailThreshold in interface GuardrailsConfig
      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 interface GuardrailsConfig
      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 interface GuardrailsConfig
      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 interface GuardrailsConfig
      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 interface GuardrailsConfig
      Returns:
      The threshold to warn when replication factor is lesser than threshold.
    • getMinimumReplicationFactorFailThreshold

      public int getMinimumReplicationFactorFailThreshold()
      Specified by:
      getMinimumReplicationFactorFailThreshold in interface GuardrailsConfig
      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 interface GuardrailsConfig
      Returns:
      The threshold to warn when replication factor is greater than threshold.
    • getMaximumReplicationFactorFailThreshold

      public int getMaximumReplicationFactorFailThreshold()
      Specified by:
      getMaximumReplicationFactorFailThreshold in interface GuardrailsConfig
      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 interface GuardrailsConfig
      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 interface GuardrailsConfig
      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 interface GuardrailsConfig
      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 interface GuardrailsConfig
      Parameters:
      value - true if 0 default TTL on TWCS tables is allowed, false otherwise.
    • getIntersectFilteringQueryWarned

      public boolean getIntersectFilteringQueryWarned()
      Specified by:
      getIntersectFilteringQueryWarned in interface GuardrailsConfig
      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 interface GuardrailsConfig
    • getIntersectFilteringQueryEnabled

      public boolean getIntersectFilteringQueryEnabled()
      Specified by:
      getIntersectFilteringQueryEnabled in interface GuardrailsConfig
      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 interface GuardrailsConfig
    • getMaximumTimestampWarnThreshold

      public DurationSpec.LongMicrosecondsBound getMaximumTimestampWarnThreshold()
      Specified by:
      getMaximumTimestampWarnThreshold in interface GuardrailsConfig
      Returns:
      A timestamp that if a user supplied timestamp is after will trigger a warning
    • getMaximumTimestampFailThreshold

      public DurationSpec.LongMicrosecondsBound getMaximumTimestampFailThreshold()
      Specified by:
      getMaximumTimestampFailThreshold in interface GuardrailsConfig
      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 interface GuardrailsConfig
      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 interface GuardrailsConfig
      Returns:
      A timestamp that if a user supplied timestamp is before will trigger a warning
    • getMinimumTimestampFailThreshold

      public DurationSpec.LongMicrosecondsBound getMinimumTimestampFailThreshold()
      Specified by:
      getMinimumTimestampFailThreshold in interface GuardrailsConfig
      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 interface GuardrailsConfig
      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 interface GuardrailsConfig
      Returns:
      the warning threshold for the number of SAI SSTable indexes searched by a query
    • getSaiSSTableIndexesPerQueryFailThreshold

      public int getSaiSSTableIndexesPerQueryFailThreshold()
      Specified by:
      getSaiSSTableIndexesPerQueryFailThreshold in interface GuardrailsConfig
      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 interface GuardrailsConfig
      Parameters:
      warn - value to set for warn threshold
      fail - value to set for fail threshold
    • getSaiStringTermSizeWarnThreshold

      @Nullable public DataStorageSpec.LongBytesBound getSaiStringTermSizeWarnThreshold()
      Specified by:
      getSaiStringTermSizeWarnThreshold in interface GuardrailsConfig
      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 interface GuardrailsConfig
      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 interface GuardrailsConfig
      Parameters:
      warn - value to set for warn threshold
      fail - value to set for fail threshold
    • getSaiFrozenTermSizeWarnThreshold

      @Nullable public DataStorageSpec.LongBytesBound getSaiFrozenTermSizeWarnThreshold()
      Specified by:
      getSaiFrozenTermSizeWarnThreshold in interface GuardrailsConfig
      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 interface GuardrailsConfig
      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 interface GuardrailsConfig
      Parameters:
      warn - value to set for warn threshold
      fail - value to set for fail threshold
    • getSaiVectorTermSizeWarnThreshold

      @Nullable public DataStorageSpec.LongBytesBound getSaiVectorTermSizeWarnThreshold()
      Specified by:
      getSaiVectorTermSizeWarnThreshold in interface GuardrailsConfig
      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 interface GuardrailsConfig
      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 interface GuardrailsConfig
      Parameters:
      warn - value to set for warn threshold
      fail - 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 interface GuardrailsConfig
      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 interface GuardrailsConfig
      Parameters:
      enabled - true if a query without partition key is enabled or not
    • getVectorTypeEnabled

      public boolean getVectorTypeEnabled()
      Specified by:
      getVectorTypeEnabled in interface GuardrailsConfig
      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 interface GuardrailsConfig
    • validateTimestampThreshold

      public static void validateTimestampThreshold(DurationSpec.LongMicrosecondsBound warn, DurationSpec.LongMicrosecondsBound fail, String name)