Package org.apache.cassandra.config
Enum Class Converters
- All Implemented Interfaces:
Serializable,Comparable<Converters>,Constable
Converters for backward compatibility with the old cassandra.yaml where duration, data rate and
data storage configuration parameters were provided only by value and the expected unit was part of the configuration
parameter name(suffix). (CASSANDRA-15234)
It is important to be noted that this converter is not intended to be used when we don't change name of a configuration
parameter but we want to add unit. This would always default to the old value provided without a unit at the moment.
In case this functionality is needed at some point, please, raise a Jira ticket. There is only one exception handling
three parameters (key_cache_save_period, row_cache_save_period, counter_cache_save_period) - the SECONDS_CUSTOM_DURATION
converter.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThis converter is used to support backward compatibility for parameters where in the past negative number was used as a value Example: native_transport_max_concurrent_requests_in_bytes_per_ip = -1 and native_transport_max_request_data_in_flight_per_ip = null are equal.This converter is used when we change the name of a cassandra.yaml configuration parameter but we want to be able to still use the old name too.This converter is a custom one to support backward compatibility for stream_throughput_outbound and inter_dc_stream_throughput_outbound which were provided in megabits per second prior CASSANDRA-15234.This converter is used to support backward compatibility for parameters where in the past -1 was used as a value Example: credentials_update_interval_in_ms = -1 and credentials_update_interval = null are equal.This converter is used to support backward compatibility for parameters where in the past -1 was used as a value Example: index_summary_resize_interval_in_minutes = -1 and index_summary_resize_interval = null are equal.This converter is used to support backward compatibility for Duration parameters where we added the opportunity for the users to add a unit in the parameters' values but we didn't change the names. -
Method Summary
Modifier and TypeMethodDescriptionClass<?>Expected return type fromconvert(Object), and input type tounconvert(Object)Class<?>static ConvertersReturns the enum constant of this class with the specified name.static Converters[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
IDENTITY
This converter is used when we change the name of a cassandra.yaml configuration parameter but we want to be able to still use the old name too. No units involved. -
INTEGER_PRIMITIVE_LONG
-
MILLIS_DURATION_LONG
-
MILLIS_DURATION_INT
-
MILLIS_DURATION_DOUBLE
-
MILLIS_CUSTOM_DURATION
This converter is used to support backward compatibility for parameters where in the past -1 was used as a value Example: credentials_update_interval_in_ms = -1 and credentials_update_interval = null are equal. -
SECONDS_DURATION
-
NEGATIVE_SECONDS_DURATION
-
SECONDS_CUSTOM_DURATION
This converter is used to support backward compatibility for Duration parameters where we added the opportunity for the users to add a unit in the parameters' values but we didn't change the names. (key_cache_save_period, row_cache_save_period, counter_cache_save_period) Example: row_cache_save_period = 0 and row_cache_save_period = 0s (quantity of 0s) are equal. -
MINUTES_CUSTOM_DURATION
This converter is used to support backward compatibility for parameters where in the past -1 was used as a value Example: index_summary_resize_interval_in_minutes = -1 and index_summary_resize_interval = null are equal. -
MEBIBYTES_DATA_STORAGE_LONG
-
MEBIBYTES_DATA_STORAGE_INT
-
NEGATIVE_MEBIBYTES_DATA_STORAGE_INT
-
KIBIBYTES_DATASTORAGE
-
BYTES_DATASTORAGE
-
LONG_BYTES_DATASTORAGE_MEBIBYTES_INT
-
LONG_BYTES_DATASTORAGE_MEBIBYTES_DATASTORAGE
-
BYTES_CUSTOM_DATASTORAGE
This converter is used to support backward compatibility for parameters where in the past negative number was used as a value Example: native_transport_max_concurrent_requests_in_bytes_per_ip = -1 and native_transport_max_request_data_in_flight_per_ip = null are equal. All negative numbers are printed as 0 in virtual tables. -
MEBIBYTES_PER_SECOND_DATA_RATE
-
MEGABITS_TO_BYTES_PER_SECOND_DATA_RATE
This converter is a custom one to support backward compatibility for stream_throughput_outbound and inter_dc_stream_throughput_outbound which were provided in megabits per second prior CASSANDRA-15234. -
KEYSPACE_COUNT_THRESHOLD_TO_GUARDRAIL
-
TABLE_COUNT_THRESHOLD_TO_GUARDRAIL
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getOldType
A method to identify what type is needed to be returned by the converter used for a configuration parameter inReplacesannotation inConfig- Returns:
- class type
-
getNewType
Expected return type fromconvert(Object), and input type tounconvert(Object)- Returns:
- type that
convert(Object)is expected to return
-
convert
- Parameters:
value- we will use from cassandra.yaml to create a newConfigparameter of typeDurationSpec,DataRateSpecorDataStorageSpec- Returns:
- new object of type
DurationSpec,DataRateSpecorDataStorageSpec
-
unconvert
Apply the converter specified as part of theReplacesannotation inConfigto get config parameters' values in the old format pre-CASSANDRA-15234 and in the right units, used in the Virtual Tables to ensure backward compatibility- Parameters:
value- we will use to calculate the output value- Returns:
- the numeric value
-