Package org.apache.cassandra.config
Class DurationSpec.LongNanosecondsBound
java.lang.Object
org.apache.cassandra.config.DurationSpec
org.apache.cassandra.config.DurationSpec.LongNanosecondsBound
- Enclosing class:
- 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)
-
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
ConstructorsConstructorDescriptionLongNanosecondsBound(long nanoseconds) Creates aDurationSpec.LongNanosecondsBoundof the specified amount in nanoseconds.LongNanosecondsBound(long quantity, TimeUnit unit) Creates aDurationSpec.LongNanosecondsBoundof the specified amount in the specified unit.LongNanosecondsBound(String value) Creates aDurationSpec.LongNanosecondsBoundof the specified amount. -
Method Summary
-
Constructor Details
-
LongNanosecondsBound
Creates aDurationSpec.LongNanosecondsBoundof the specified amount. The bound is [0, Long.MAX_VALUE) in nanoseconds.- Parameters:
value- the duration
-
LongNanosecondsBound
Creates aDurationSpec.LongNanosecondsBoundof 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 nanosecondsunit- in which the provided quantity is
-
LongNanosecondsBound
public LongNanosecondsBound(long nanoseconds) Creates aDurationSpec.LongNanosecondsBoundof 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
-