Class DurationSpec.LongSecondsBound

java.lang.Object
org.apache.cassandra.config.DurationSpec
org.apache.cassandra.config.DurationSpec.LongSecondsBound
Enclosing class:
DurationSpec

public static final class DurationSpec.LongSecondsBound extends DurationSpec
Represents a duration used for Cassandra configuration. The bound is [0, Long.MAX_VALUE) in seconds. If the user sets a different unit - we still validate that converted to seconds the quantity will not exceed that upper bound. (CASSANDRA-17571)
  • Constructor Details

    • LongSecondsBound

      public LongSecondsBound(String value)
      Creates a DurationSpec.LongSecondsBound of the specified amount. The bound is [0, Long.MAX_VALUE) in seconds.
      Parameters:
      value - the duration
    • LongSecondsBound

      public LongSecondsBound(long quantity, TimeUnit unit)
      Creates a DurationSpec.LongSecondsBound of the specified amount in the specified unit. The bound is [0, Long.MAX_VALUE) in seconds.
      Parameters:
      quantity - where quantity shouldn't be bigger than Long.MAX_VALUE - 1 in seconds
      unit - in which the provided quantity is
    • LongSecondsBound

      public LongSecondsBound(long seconds)
      Creates a DurationSpec.LongSecondsBound of the specified amount in seconds. The bound is [0, Long.MAX_VALUE) in seconds.
      Parameters:
      seconds - where seconds shouldn't be bigger than Long.MAX_VALUE-1
  • Method Details

    • toMilliseconds

      public long toMilliseconds()
      Returns:
      this duration in number of milliseconds
    • toSeconds

      public long toSeconds()
      Returns:
      this duration in number of seconds