Class 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)
    • Method Detail

      • 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 java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object