Class DurationSpec.IntMillisecondsBound

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

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

    • IntMillisecondsBound

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

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

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

      public IntMillisecondsBound(double quantity, TimeUnit unit)
      Below constructor is used only for backward compatibility for the old commitlog_sync_group_window_in_ms before 4.1 Creates a DurationSpec.IntMillisecondsBound of the specified amount in the specified unit.
      Parameters:
      quantity - where quantity shouldn't be bigger than Intetger.MAX_VALUE - 1 in milliseconds
      unit - in which the provided quantity is
  • Method Details

    • toMilliseconds

      public int toMilliseconds()
      Returns this duration in number of milliseconds as an int
      Returns:
      this duration in number of milliseconds or Integer.MAX_VALUE if the number of milliseconds is too large.