Package org.apache.cassandra.config
Class DataStorageSpec.IntMebibytesBound
- java.lang.Object
-
- org.apache.cassandra.config.DataStorageSpec
-
- org.apache.cassandra.config.DataStorageSpec.IntMebibytesBound
-
- Enclosing class:
- DataStorageSpec
public static final class DataStorageSpec.IntMebibytesBound extends DataStorageSpec
Represents a data storage quantity used for Cassandra configuration. The bound is [0, Integer.MAX_VALUE) in mebibytes. If the user sets a different unit - we still validate that converted to mebibytes 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
Constructors Constructor Description IntMebibytesBound(long mebibytes)Creates aDataStorageSpec.IntMebibytesBoundof the specified amount in mebibytes.IntMebibytesBound(long quantity, DataStorageSpec.DataStorageUnit unit)Creates aDataStorageSpec.IntMebibytesBoundof the specified amount in the specified unit.IntMebibytesBound(java.lang.String value)Creates aDataStorageSpec.IntMebibytesBoundof the specified amount.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description inttoBytes()Returns the amount of data storage in bytes as anintlongtoBytesInLong()Returns the amount of data storage in bytes aslonginttoKibibytes()Returns the amount of data storage in kibibytes as anintinttoMebibytes()Returns the amount of data storage in mebibytes as anint
-
-
-
Constructor Detail
-
IntMebibytesBound
public IntMebibytesBound(java.lang.String value)
Creates aDataStorageSpec.IntMebibytesBoundof the specified amount.- Parameters:
value- the data storage
-
IntMebibytesBound
public IntMebibytesBound(long quantity, DataStorageSpec.DataStorageUnit unit)Creates aDataStorageSpec.IntMebibytesBoundof the specified amount in the specified unit.- Parameters:
quantity- where quantity shouldn't be bigger than Integer.MAX_VALUE - 1 in mebibytesunit- in which the provided quantity is
-
IntMebibytesBound
public IntMebibytesBound(long mebibytes)
Creates aDataStorageSpec.IntMebibytesBoundof the specified amount in mebibytes.- Parameters:
mebibytes- where mebibytes shouldn't be bigger than Integer.MAX_VALUE-1
-
-
Method Detail
-
toBytes
public int toBytes()
Returns the amount of data storage in bytes as anint- Returns:
- the amount of data storage in bytes or
Integer.MAX_VALUEif the number of bytes is too large.
-
toKibibytes
public int toKibibytes()
Returns the amount of data storage in kibibytes as anint- Returns:
- the amount of data storage in kibibytes or
Integer.MAX_VALUEif the number of kibibytes is too large.
-
toMebibytes
public int toMebibytes()
Returns the amount of data storage in mebibytes as anint- Returns:
- the amount of data storage in mebibytes or
Integer.MAX_VALUEif the number of mebibytes is too large.
-
toBytesInLong
public long toBytesInLong()
Returns the amount of data storage in bytes aslong- Returns:
- the amount of data storage in bytes.
-
-