Interface GuardrailsMBean

  • All Known Implementing Classes:
    Guardrails

    public interface GuardrailsMBean
    JMX entrypoint for updating the default guardrails configuration parsed from cassandra.yaml.

    This is different to just exposing GuardrailsConfig in that the methods here should be JMX-friendly.

    For consistency, guardrails based on a simple numeric threshold should use the naming scheme <whatIsGuarded>WarnThreshold for soft limits and <whatIsGuarded>FailThreshold for hard ones, and if the value has a unit, that unit should be added at the end (for instance, <whatIsGuarded>FailThresholdInKb). For "boolean" guardrails that disable a feature, use <whatIsGuardedEnabled. Other type of guardrails can use appropriate suffixes but should start with <whatIsGuarded>.

    • Method Detail

      • getKeyspacesWarnThreshold

        int getKeyspacesWarnThreshold()
        Returns:
        The threshold to warn when creating more user keyspaces than threshold. -1 means disabled.
      • getKeyspacesFailThreshold

        int getKeyspacesFailThreshold()
        Returns:
        The threshold to prevent creating more user keyspaces than threshold. -1 means disabled.
      • setKeyspacesThreshold

        void setKeyspacesThreshold​(int warn,
                                   int fail)
        Parameters:
        warn - The threshold to warn when creating more user keyspaces than threshold. -1 means disabled.
        fail - The threshold to prevent creating more user keyspaces than threshold. -1 means disabled.
      • getTablesWarnThreshold

        int getTablesWarnThreshold()
        Returns:
        The threshold to warn when creating more tables than threshold. -1 means disabled.
      • getTablesFailThreshold

        int getTablesFailThreshold()
        Returns:
        The threshold to prevent creating more tables than threshold. -1 means disabled.
      • setTablesThreshold

        void setTablesThreshold​(int warn,
                                int fail)
        Parameters:
        warn - The threshold to warn when creating more tables than threshold. -1 means disabled.
        fail - The threshold to prevent creating more tables than threshold. -1 means disabled.
      • getColumnsPerTableWarnThreshold

        int getColumnsPerTableWarnThreshold()
        Returns:
        The threshold to warn when having more columns per table than threshold. -1 means disabled.
      • getColumnsPerTableFailThreshold

        int getColumnsPerTableFailThreshold()
        Returns:
        The threshold to prevent having more columns per table than threshold. -1 means disabled.
      • setColumnsPerTableThreshold

        void setColumnsPerTableThreshold​(int warn,
                                         int fail)
        Parameters:
        warn - The threshold to warn when having more columns per table than threshold. -1 means disabled.
        fail - The threshold to prevent having more columns per table than threshold. -1 means disabled.
      • getSecondaryIndexesPerTableWarnThreshold

        int getSecondaryIndexesPerTableWarnThreshold()
        Returns:
        The threshold to warn when creating more secondary indexes per table than threshold. -1 means disabled.
      • getSecondaryIndexesPerTableFailThreshold

        int getSecondaryIndexesPerTableFailThreshold()
        Returns:
        The threshold to prevent creating more secondary indexes per table than threshold. -1 means disabled.
      • setSecondaryIndexesPerTableThreshold

        void setSecondaryIndexesPerTableThreshold​(int warn,
                                                  int fail)
        Parameters:
        warn - The threshold to warn when creating more secondary indexes per table than threshold. -1 means disabled.
        fail - The threshold to prevent creating more secondary indexes per table than threshold. -1 means disabled.
      • getSecondaryIndexesEnabled

        boolean getSecondaryIndexesEnabled()
        Returns:
        Whether secondary index creation is active or not on the node
      • setSecondaryIndexesEnabled

        void setSecondaryIndexesEnabled​(boolean enabled)
        Enables or disables the ability to create secondary indexes
        Parameters:
        enabled -
      • getMaterializedViewsPerTableWarnThreshold

        int getMaterializedViewsPerTableWarnThreshold()
        Returns:
        The threshold to warn when creating more materialized views per table than threshold. -1 means disabled.
      • getMaterializedViewsPerTableFailThreshold

        int getMaterializedViewsPerTableFailThreshold()
        Returns:
        The threshold to prevent creating more materialized views per table than threshold. -1 means disabled.
      • setMaterializedViewsPerTableThreshold

        void setMaterializedViewsPerTableThreshold​(int warn,
                                                   int fail)
        Parameters:
        warn - The threshold to warn when creating more materialized views per table than threshold. -1 means disabled.
        fail - The threshold to prevent creating more materialized views per table than threshold. -1 means disabled.
      • getTablePropertiesWarned

        java.util.Set<java.lang.String> getTablePropertiesWarned()
        Returns:
        properties that are warned about when creating or altering a table.
      • getTablePropertiesWarnedCSV

        java.lang.String getTablePropertiesWarnedCSV()
        Returns:
        Comma-separated list of properties that are warned about when creating or altering a table.
      • setTablePropertiesWarned

        void setTablePropertiesWarned​(java.util.Set<java.lang.String> properties)
        Parameters:
        properties - properties that are warned about when creating or altering a table.
      • setTablePropertiesWarnedCSV

        void setTablePropertiesWarnedCSV​(java.lang.String properties)
        Parameters:
        properties - Comma-separated list of properties that are warned about when creating or altering a table.
      • getTablePropertiesDisallowed

        java.util.Set<java.lang.String> getTablePropertiesDisallowed()
        Returns:
        properties that are not allowed when creating or altering a table.
      • getTablePropertiesDisallowedCSV

        java.lang.String getTablePropertiesDisallowedCSV()
        Returns:
        Comma-separated list of properties that are not allowed when creating or altering a table.
      • setTablePropertiesDisallowed

        void setTablePropertiesDisallowed​(java.util.Set<java.lang.String> properties)
        Parameters:
        properties - properties that are not allowed when creating or altering a table.
      • setTablePropertiesDisallowedCSV

        void setTablePropertiesDisallowedCSV​(java.lang.String properties)
        Parameters:
        properties - Comma-separated list of properties that are not allowed when creating or altering a table.
      • getTablePropertiesIgnored

        java.util.Set<java.lang.String> getTablePropertiesIgnored()
        Returns:
        properties that are ignored when creating or altering a table.
      • getTablePropertiesIgnoredCSV

        java.lang.String getTablePropertiesIgnoredCSV()
        Returns:
        Comma-separated list of properties that are ignored when creating or altering a table.
      • setTablePropertiesIgnored

        void setTablePropertiesIgnored​(java.util.Set<java.lang.String> properties)
        Parameters:
        properties - properties that are ignored when creating or altering a table.
      • setTablePropertiesIgnoredCSV

        void setTablePropertiesIgnoredCSV​(java.lang.String properties)
        Parameters:
        properties - Comma-separated list of properties that are ignored when creating or altering a table.
      • getUserTimestampsEnabled

        boolean getUserTimestampsEnabled()
        Returns whether user-provided timestamps are allowed.
        Returns:
        true if user-provided timestamps are allowed, false otherwise.
      • setUserTimestampsEnabled

        void setUserTimestampsEnabled​(boolean enabled)
        Sets whether user-provided timestamps are allowed.
        Parameters:
        enabled - true if user-provided timestamps are allowed, false otherwise.
      • getAllowFilteringEnabled

        boolean getAllowFilteringEnabled()
        Returns whether ALLOW FILTERING property is allowed.
        Returns:
        true if ALLOW FILTERING is allowed, false otherwise.
      • setAllowFilteringEnabled

        void setAllowFilteringEnabled​(boolean enabled)
        Sets whether ALLOW FILTERING is allowed.
        Parameters:
        enabled - true if ALLOW FILTERING is allowed, false otherwise.
      • getUncompressedTablesEnabled

        boolean getUncompressedTablesEnabled()
        Returns whether users can disable compression on tables
        Returns:
        true if users can disable compression on a table, false otherwise.
      • setUncompressedTablesEnabled

        void setUncompressedTablesEnabled​(boolean enabled)
        Sets whether users can disable compression on tables
        Parameters:
        enabled - true if users can disable compression on a table, false otherwise.
      • getCompactTablesEnabled

        boolean getCompactTablesEnabled()
        Returns whether users can create new COMPACT STORAGE tables
        Returns:
        true if allowed, false otherwise.
      • setCompactTablesEnabled

        void setCompactTablesEnabled​(boolean enabled)
        Sets whether users can create new COMPACT STORAGE tables
        Parameters:
        enabled - true if allowed, false otherwise.
      • getGroupByEnabled

        boolean getGroupByEnabled()
        Returns whether GROUP BY queries are allowed.
        Returns:
        true if allowed, false otherwise.
      • setGroupByEnabled

        void setGroupByEnabled​(boolean enabled)
        Sets whether GROUP BY queries are allowed.
        Parameters:
        enabled - true if allowed, false otherwise.
      • getDropTruncateTableEnabled

        boolean getDropTruncateTableEnabled()
        Returns whether users can TRUNCATE or DROP TABLE
        Returns:
        true if allowed, false otherwise.
      • setDropTruncateTableEnabled

        void setDropTruncateTableEnabled​(boolean enabled)
        Sets whether users can TRUNCATE or DROP TABLE
      • getPageSizeWarnThreshold

        int getPageSizeWarnThreshold()
        Returns:
        The threshold to warn when requested page size greater than threshold. -1 means disabled.
      • getPageSizeFailThreshold

        int getPageSizeFailThreshold()
        Returns:
        The threshold to prevent requesting page with more elements than threshold. -1 means disabled.
      • setPageSizeThreshold

        void setPageSizeThreshold​(int warn,
                                  int fail)
        Parameters:
        warn - The threshold to warn when the requested page size is greater than threshold. -1 means disabled.
        fail - The threshold to prevent requesting pages with more elements than threshold. -1 means disabled.
      • getReadBeforeWriteListOperationsEnabled

        boolean getReadBeforeWriteListOperationsEnabled()
        Returns whether list operations that require read before write are allowed.
        Returns:
        true if list operations that require read before write are allowed, false otherwise.
      • setReadBeforeWriteListOperationsEnabled

        void setReadBeforeWriteListOperationsEnabled​(boolean enabled)
        Sets whether list operations that require read before write are allowed.
        Parameters:
        enabled - true if list operations that require read before write are allowed, false otherwise.
      • getPartitionKeysInSelectWarnThreshold

        int getPartitionKeysInSelectWarnThreshold()
        Returns:
        The threshold to warn when the number of partition keys in a select statement greater than threshold. -1 means disabled.
      • getPartitionKeysInSelectFailThreshold

        int getPartitionKeysInSelectFailThreshold()
        Returns:
        The threshold to fail when the number of partition keys in a select statement greater than threshold. -1 means disabled.
      • setPartitionKeysInSelectThreshold

        void setPartitionKeysInSelectThreshold​(int warn,
                                               int fail)
        Parameters:
        warn - The threshold to warn when the number of partition keys in a select statement is greater than threshold -1 means disabled.
        fail - The threshold to prevent when the number of partition keys in a select statement is more than threshold -1 means disabled.
      • getInSelectCartesianProductWarnThreshold

        int getInSelectCartesianProductWarnThreshold()
        Returns:
        The threshold to warn when an IN query creates a cartesian product with a size exceeding threshold. -1 means disabled.
      • getInSelectCartesianProductFailThreshold

        int getInSelectCartesianProductFailThreshold()
        Returns:
        The threshold to prevent IN queries creating a cartesian product with a size exceeding threshold. -1 means disabled.
      • setInSelectCartesianProductThreshold

        void setInSelectCartesianProductThreshold​(int warn,
                                                  int fail)
        Parameters:
        warn - The threshold to warn when an IN query creates a cartesian product with a size exceeding threshold. -1 means disabled.
        fail - The threshold to prevent IN queries creating a cartesian product with a size exceeding threshold. -1 means disabled.
      • getReadConsistencyLevelsWarned

        java.util.Set<java.lang.String> getReadConsistencyLevelsWarned()
        Returns:
        consistency levels that are warned about when reading.
      • getReadConsistencyLevelsWarnedCSV

        java.lang.String getReadConsistencyLevelsWarnedCSV()
        Returns:
        Comma-separated list of consistency levels that are warned about when reading.
      • setReadConsistencyLevelsWarned

        void setReadConsistencyLevelsWarned​(java.util.Set<java.lang.String> consistencyLevels)
        Parameters:
        consistencyLevels - consistency levels that are warned about when reading.
      • setReadConsistencyLevelsWarnedCSV

        void setReadConsistencyLevelsWarnedCSV​(java.lang.String consistencyLevels)
        Parameters:
        consistencyLevels - Comma-separated list of consistency levels that are warned about when reading.
      • getReadConsistencyLevelsDisallowed

        java.util.Set<java.lang.String> getReadConsistencyLevelsDisallowed()
        Returns:
        consistency levels that are not allowed when reading.
      • getReadConsistencyLevelsDisallowedCSV

        java.lang.String getReadConsistencyLevelsDisallowedCSV()
        Returns:
        Comma-separated list of consistency levels that are not allowed when reading.
      • setReadConsistencyLevelsDisallowed

        void setReadConsistencyLevelsDisallowed​(java.util.Set<java.lang.String> consistencyLevels)
        Parameters:
        consistencyLevels - consistency levels that are not allowed when reading.
      • setReadConsistencyLevelsDisallowedCSV

        void setReadConsistencyLevelsDisallowedCSV​(java.lang.String consistencyLevels)
        Parameters:
        consistencyLevels - Comma-separated list of consistency levels that are not allowed when reading.
      • getWriteConsistencyLevelsWarned

        java.util.Set<java.lang.String> getWriteConsistencyLevelsWarned()
        Returns:
        consistency levels that are warned about when writing.
      • getWriteConsistencyLevelsWarnedCSV

        java.lang.String getWriteConsistencyLevelsWarnedCSV()
        Returns:
        Comma-separated list of consistency levels that are warned about when writing.
      • setWriteConsistencyLevelsWarned

        void setWriteConsistencyLevelsWarned​(java.util.Set<java.lang.String> consistencyLevels)
        Parameters:
        consistencyLevels - consistency levels that are warned about when writing.
      • setWriteConsistencyLevelsWarnedCSV

        void setWriteConsistencyLevelsWarnedCSV​(java.lang.String consistencyLevels)
        Parameters:
        consistencyLevels - Comma-separated list of consistency levels that are warned about when writing.
      • getWriteConsistencyLevelsDisallowed

        java.util.Set<java.lang.String> getWriteConsistencyLevelsDisallowed()
        Returns:
        consistency levels that are not allowed when writing.
      • getWriteConsistencyLevelsDisallowedCSV

        java.lang.String getWriteConsistencyLevelsDisallowedCSV()
        Returns:
        Comma-separated list of consistency levels that are not allowed when writing.
      • setWriteConsistencyLevelsDisallowed

        void setWriteConsistencyLevelsDisallowed​(java.util.Set<java.lang.String> consistencyLevels)
        Parameters:
        consistencyLevels - consistency levels that are not allowed when writing.
      • setWriteConsistencyLevelsDisallowedCSV

        void setWriteConsistencyLevelsDisallowedCSV​(java.lang.String consistencyLevels)
        Parameters:
        consistencyLevels - Comma-separated list of consistency levels that are not allowed when writing.
      • getCollectionSizeWarnThreshold

        @Nullable
        java.lang.String getCollectionSizeWarnThreshold()
        Returns:
        The threshold to warn when encountering larger size of collection data than threshold, as a string formatted as in, for example, 10GiB, 20MiB, 30KiB or 40B. A null value means that the threshold is disabled.
      • getCollectionSizeFailThreshold

        @Nullable
        java.lang.String getCollectionSizeFailThreshold()
        Returns:
        The threshold to prevent collections with larger data size than threshold, as a string formatted as in, for example, 10GiB, 20MiB, 30KiB or 40B. A null value means that the threshold is disabled.
      • setCollectionSizeThreshold

        void setCollectionSizeThreshold​(@Nullable
                                        java.lang.String warnSize,
                                        @Nullable
                                        java.lang.String failSize)
        Parameters:
        warnSize - The threshold to warn when encountering larger size of collection data than threshold, as a string formatted as in, for example, 10GiB, 20MiB, 30KiB or 40B. A null value means disabled.
        failSize - The threshold to prevent collections with larger data size than threshold, as a string formatted as in, for example, 10GiB, 20MiB, 30KiB or 40B. A null value means disabled.
      • getItemsPerCollectionWarnThreshold

        int getItemsPerCollectionWarnThreshold()
        Returns:
        The threshold to warn when encountering more elements in a collection than threshold.
      • getItemsPerCollectionFailThreshold

        int getItemsPerCollectionFailThreshold()
        Returns:
        The threshold to prevent collections with more elements than threshold.
      • setItemsPerCollectionThreshold

        void setItemsPerCollectionThreshold​(int warn,
                                            int fail)
        Parameters:
        warn - The threshold to warn when encountering more elements in a collection than threshold.
        fail - The threshold to prevent collectiosn with more elements than threshold.
      • getFieldsPerUDTWarnThreshold

        int getFieldsPerUDTWarnThreshold()
        Returns:
        The threshold to warn when creating a UDT with more fields than threshold. -1 means disabled.
      • getFieldsPerUDTFailThreshold

        int getFieldsPerUDTFailThreshold()
        Returns:
        The threshold to fail when creating a UDT with more fields than threshold. -1 means disabled.
      • setFieldsPerUDTThreshold

        void setFieldsPerUDTThreshold​(int warn,
                                      int fail)
        Parameters:
        warn - The threshold to warn when creating a UDT with more fields than threshold. -1 means disabled.
        fail - The threshold to prevent creating a UDT with more fields than threshold. -1 means disabled.
      • getDataDiskUsagePercentageWarnThreshold

        int getDataDiskUsagePercentageWarnThreshold()
        Returns:
        The threshold to warn when local data disk usage percentage exceeds that threshold. Allowed values are in the range [1, 100], and -1 means disabled.
      • getDataDiskUsagePercentageFailThreshold

        int getDataDiskUsagePercentageFailThreshold()
        Returns:
        The threshold to fail when local data disk usage percentage exceeds that threshold. Allowed values are in the range [1, 100], and -1 means disabled.
      • setDataDiskUsagePercentageThreshold

        void setDataDiskUsagePercentageThreshold​(int warn,
                                                 int fail)
        Parameters:
        warn - The threshold to warn when local disk usage percentage exceeds that threshold. Allowed values are in the range [1, 100], and -1 means disabled.
        fail - The threshold to fail when local disk usage percentage exceeds that threshold. Allowed values are in the range [1, 100], and -1 means disabled.
      • getDataDiskUsageMaxDiskSize

        @Nullable
        java.lang.String getDataDiskUsageMaxDiskSize()
        Returns:
        The max disk size of the data directories when calculating disk usage thresholds, as a string formatted as in, for example, 10GiB, 20MiB, 30KiB or 40B. A null value means disabled.
      • setDataDiskUsageMaxDiskSize

        void setDataDiskUsageMaxDiskSize​(@Nullable
                                         java.lang.String size)
        Parameters:
        size - The max disk size of the data directories when calculating disk usage thresholds, as a string formatted as in, for example, 10GiB, 20MiB, 30KiB or 40B. A null value means disabled.
      • getMinimumReplicationFactorWarnThreshold

        int getMinimumReplicationFactorWarnThreshold()
        Returns:
        The threshold to warn when replication factor is lesser threshold.
      • getMinimumReplicationFactorFailThreshold

        int getMinimumReplicationFactorFailThreshold()
        Returns:
        The threshold to fail when replication factor is lesser threshold.
      • setMinimumReplicationFactorThreshold

        void setMinimumReplicationFactorThreshold​(int warn,
                                                  int fail)
        Parameters:
        warn - the threshold to warn when the minimum replication factor is lesser than threshold -1 means disabled.
        fail - the threshold to fail when the minimum replication factor is lesser than threshold -1 means disabled.