Package org.apache.cassandra.config
Class DurationSpec.IntMillisecondsBound
java.lang.Object
org.apache.cassandra.config.DurationSpec
org.apache.cassandra.config.DurationSpec.IntMillisecondsBound
- Enclosing class:
- 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)
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.cassandra.config.DurationSpec
DurationSpec.IntMillisecondsBound, DurationSpec.IntMinutesBound, DurationSpec.IntSecondsBound, DurationSpec.LongMicrosecondsBound, DurationSpec.LongMillisecondsBound, DurationSpec.LongNanosecondsBound, DurationSpec.LongSecondsBound -
Constructor Summary
ConstructorsConstructorDescriptionIntMillisecondsBound(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 aDurationSpec.IntMillisecondsBoundof the specified amount in the specified unit.IntMillisecondsBound(long milliseconds) Creates aDurationSpec.IntMillisecondsBoundof the specified amount in milliseconds.IntMillisecondsBound(long quantity, TimeUnit unit) Creates aDurationSpec.IntMillisecondsBoundof the specified amount in the specified unit.IntMillisecondsBound(String value) Creates aDurationSpec.IntMillisecondsBoundof the specified amount. -
Method Summary
Modifier and TypeMethodDescriptionintReturns this duration in number of milliseconds as anint
-
Constructor Details
-
IntMillisecondsBound
Creates aDurationSpec.IntMillisecondsBoundof 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
Creates aDurationSpec.IntMillisecondsBoundof 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 millisecondsunit- in which the provided quantity is
-
IntMillisecondsBound
public IntMillisecondsBound(long milliseconds) Creates aDurationSpec.IntMillisecondsBoundof 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
Below constructor is used only for backward compatibility for the old commitlog_sync_group_window_in_ms before 4.1 Creates aDurationSpec.IntMillisecondsBoundof the specified amount in the specified unit.- Parameters:
quantity- where quantity shouldn't be bigger than Intetger.MAX_VALUE - 1 in millisecondsunit- in which the provided quantity is
-
-
Method Details
-
toMilliseconds
public int toMilliseconds()Returns this duration in number of milliseconds as anint- Returns:
- this duration in number of milliseconds or
Integer.MAX_VALUEif the number of milliseconds is too large.
-