Class DataRateSpec

java.lang.Object
org.apache.cassandra.config.DataRateSpec
Direct Known Subclasses:
DataRateSpec.LongBytesPerSecondBound

public abstract class DataRateSpec extends 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)
  • 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 an int
      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 an int
      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 an int
      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 an int. 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 class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object