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.ObjectRepresents 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 classDataRateSpec.DataRateUnitstatic classDataRateSpec.LongBytesPerSecondBoundRepresents a data rate used for Cassandra configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)inthashCode()doubletoBytesPerSecond()inttoBytesPerSecondAsInt()Returns the data rate in bytes per second as anintdoubletoKibibytesPerSecond()inttoKibibytesPerSecondAsInt()Returns the data rate in kibibytes per second as anintdoubletoMebibytesPerSecond()inttoMebibytesPerSecondAsInt()Returns the data rate in mebibytes per second as anintdoubletoMegabitsPerSecond()This method is required in order to support backward compatibility with the old unit used for a few Data Rate parameters before CASSANDRA-15234inttoMegabitsPerSecondAsInt()Returns the data rate in megabits per second as anint.java.lang.StringtoString()DataRateSpec.DataRateUnitunit()
-
-
-
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_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()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-