Class DurationSpec.LongNanosecondsBound

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

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

    • LongNanosecondsBound

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

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

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

    • toNanoseconds

      public long toNanoseconds()
      Returns:
      this duration in number of nanoseconds