Package org.apache.cassandra.config
Class DataStorageSpec.LongBytesBound
java.lang.Object
org.apache.cassandra.config.DataStorageSpec
org.apache.cassandra.config.DataStorageSpec.LongBytesBound
- Enclosing class:
- DataStorageSpec
Represents a data storage quantity used for Cassandra configuration. The bound is [0, Long.MAX_VALUE) in bytes.
If the user sets a different unit - we still validate that converted to bytes the quantity will not exceed
that upper bound. (CASSANDRA-17571)
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.cassandra.config.DataStorageSpec
DataStorageSpec.DataStorageUnit, DataStorageSpec.IntBytesBound, DataStorageSpec.IntKibibytesBound, DataStorageSpec.IntMebibytesBound, DataStorageSpec.LongBytesBound, DataStorageSpec.LongMebibytesBound -
Constructor Summary
ConstructorsConstructorDescriptionLongBytesBound(long bytes) Creates aDataStorageSpec.LongBytesBoundof the specified amount in bytes.LongBytesBound(long quantity, DataStorageSpec.DataStorageUnit unit) Creates aDataStorageSpec.LongBytesBoundof the specified amount in the specified unit.LongBytesBound(String value) Creates aDataStorageSpec.LongBytesBoundof the specified amount. -
Method Summary
-
Constructor Details
-
LongBytesBound
Creates aDataStorageSpec.LongBytesBoundof the specified amount.- Parameters:
value- the data storage
-
LongBytesBound
Creates aDataStorageSpec.LongBytesBoundof the specified amount in the specified unit.- Parameters:
quantity- where quantity shouldn't be bigger than Long.MAX_VALUE - 1 in bytesunit- in which the provided quantity is
-
LongBytesBound
public LongBytesBound(long bytes) Creates aDataStorageSpec.LongBytesBoundof the specified amount in bytes.- Parameters:
bytes- where bytes shouldn't be bigger than Long.MAX_VALUE-1
-
-
Method Details
-
toBytes
public long toBytes()- Returns:
- the amount of data storage in bytes
-
toMebibytesInt
public int toMebibytesInt()- Returns:
- the amount of data storage in mebibytes
-