Package org.apache.cassandra.config
Class DataRateSpec
java.lang.Object
org.apache.cassandra.config.DataRateSpec
- Direct Known Subclasses:
DataRateSpec.LongBytesPerSecondBound
Represents a data rate type used for cassandra configuration. It supports the opportunity for the users to be able to
add units to the confiuration parameter value. (CASSANDRA-15234)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic final classRepresents a data rate used for Cassandra configuration. -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()doubleintReturns the data rate in bytes per second as anintdoubleintReturns the data rate in kibibytes per second as anintdoubleintReturns the data rate in mebibytes per second as anintdoubleThis method is required in order to support backward compatibility with the old unit used for a few Data Rate parameters before CASSANDRA-15234intReturns the data rate in megabits per second as anint.toString()unit()
-
Method Details
-
unit
- Returns:
- the data rate unit assigned.
-
toBytesPerSecond
public double toBytesPerSecond()- Returns:
- the data rate in bytes per second
-
toBytesPerSecondAsInt
public int toBytesPerSecondAsInt()Returns the data rate in bytes per second as anint- Returns:
- the data rate in bytes per second or
Integer.MAX_VALUEif the rate is too large.
-
toKibibytesPerSecond
public double toKibibytesPerSecond()- Returns:
- the data rate in kibibytes per second
-
toKibibytesPerSecondAsInt
public int toKibibytesPerSecondAsInt()Returns the data rate in kibibytes per second as anint- Returns:
- the data rate in kibibytes per second or
Integer.MAX_VALUEif the number of kibibytes is too large.
-
toMebibytesPerSecond
public double toMebibytesPerSecond()- Returns:
- the data rate in mebibytes per second
-
toMebibytesPerSecondAsInt
public int toMebibytesPerSecondAsInt()Returns the data rate in mebibytes per second as anint- Returns:
- the data rate in mebibytes per second or
Integer.MAX_VALUEif the number of mebibytes is too large.
-
toMegabitsPerSecond
public double toMegabitsPerSecond()This method is required in order to support backward compatibility with the old unit used for a few Data Rate parameters before CASSANDRA-15234- Returns:
- the data rate in megabits per second.
-
toMegabitsPerSecondAsInt
public int toMegabitsPerSecondAsInt()Returns the data rate in megabits per second as anint. This method is required in order to support backward compatibility with the old unit used for a few Data Rate parameters before CASSANDRA-15234- Returns:
- the data rate in mebibytes per second or
Integer.MAX_VALUEif the number of mebibytes is too large.
-
hashCode
public int hashCode() -
equals
-
toString
-