Package org.apache.flink.configuration
Enum MemorySize.MemoryUnit
- java.lang.Object
-
- java.lang.Enum<MemorySize.MemoryUnit>
-
- org.apache.flink.configuration.MemorySize.MemoryUnit
-
- All Implemented Interfaces:
Serializable,Comparable<MemorySize.MemoryUnit>
- Enclosing class:
- MemorySize
public static enum MemorySize.MemoryUnit extends Enum<MemorySize.MemoryUnit>
Enum which defines memory unit, mostly used to parse value from configuration file.To make larger values more compact, the common size suffixes are supported:
- 1b or 1bytes (bytes)
- 1k or 1kb or 1kibibytes (interpreted as kibibytes = 1024 bytes)
- 1m or 1mb or 1mebibytes (interpreted as mebibytes = 1024 kibibytes)
- 1g or 1gb or 1gibibytes (interpreted as gibibytes = 1024 mebibytes)
- 1t or 1tb or 1tebibytes (interpreted as tebibytes = 1024 gibibytes)
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BYTESGIGA_BYTESKILO_BYTESMEGA_BYTESTERA_BYTES
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringgetAllUnits()longgetMultiplier()String[]getUnits()static booleanhasUnit(String text)static MemorySize.MemoryUnitvalueOf(String name)Returns the enum constant of this type with the specified name.static MemorySize.MemoryUnit[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BYTES
public static final MemorySize.MemoryUnit BYTES
-
KILO_BYTES
public static final MemorySize.MemoryUnit KILO_BYTES
-
MEGA_BYTES
public static final MemorySize.MemoryUnit MEGA_BYTES
-
GIGA_BYTES
public static final MemorySize.MemoryUnit GIGA_BYTES
-
TERA_BYTES
public static final MemorySize.MemoryUnit TERA_BYTES
-
-
Method Detail
-
values
public static MemorySize.MemoryUnit[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (MemorySize.MemoryUnit c : MemorySize.MemoryUnit.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static MemorySize.MemoryUnit valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getUnits
public String[] getUnits()
-
getMultiplier
public long getMultiplier()
-
getAllUnits
public static String getAllUnits()
-
hasUnit
public static boolean hasUnit(String text)
-
-