Package org.apache.cassandra.config
Class DataRateSpec
- java.lang.Object
-
- org.apache.cassandra.config.DataRateSpec
-
- Direct Known Subclasses:
DataRateSpec.LongBytesPerSecondBound
public abstract class DataRateSpec extends java.lang.Object
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 Classes Modifier and Type Class Description static class
DataRateSpec.DataRateUnit
static class
DataRateSpec.LongBytesPerSecondBound
Represents a data rate used for Cassandra configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
int
hashCode()
double
toBytesPerSecond()
int
toBytesPerSecondAsInt()
Returns the data rate in bytes per second as anint
double
toKibibytesPerSecond()
int
toKibibytesPerSecondAsInt()
Returns the data rate in kibibytes per second as anint
double
toMebibytesPerSecond()
int
toMebibytesPerSecondAsInt()
Returns the data rate in mebibytes per second as anint
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-15234int
toMegabitsPerSecondAsInt()
Returns the data rate in megabits per second as anint
.java.lang.String
toString()
DataRateSpec.DataRateUnit
unit()
-
-
-
Method Detail
-
unit
public DataRateSpec.DataRateUnit 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_VALUE
if 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_VALUE
if 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_VALUE
if 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_VALUE
if the number of mebibytes is too large.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-