Package com.complexible.common.memory
Enum PredefinedMemoryRatio
- java.lang.Object
-
- java.lang.Enum<PredefinedMemoryRatio>
-
- com.complexible.common.memory.PredefinedMemoryRatio
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<PredefinedMemoryRatio>
public enum PredefinedMemoryRatio extends java.lang.Enum<PredefinedMemoryRatio>
Predefined memory configuration modes. The predefined modes specify the percentage of memory (between 0 and 100) a component will use rather then fixed amount of memory. A configuration with actual memory limits can be created using thewithAvailableMemory(long, long)
function.- Since:
- 5.0
- Version:
- 5.0
- Author:
- Evren
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BULK_LOAD
Memory configuration optimized for bulk loads.DEFAULT
Memory configuration optimized for mixed workloads.READ_OPTIMIZED
Memory configuration optimized for read queries.WRITE_OPTIMIZED
Memory configuration optimized for updates.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.common.collect.ImmutableMap<MemoryConfiguration.HeapComponent,java.lang.Integer>
getHeapRatios()
com.google.common.collect.ImmutableMap<MemoryConfiguration.NativeComponent,java.lang.Integer>
getNativeRatios()
com.google.common.collect.ImmutableMap<MemoryConfiguration.StarrocksComponent,java.lang.Integer>
getStarrocksRatios()
void
setRatios(java.util.Map<java.lang.String,java.lang.Object> theJsonMap)
java.lang.String
toString()
static PredefinedMemoryRatio
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static PredefinedMemoryRatio[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.MemoryConfiguration
withAvailableMemory(long nativeMem, long heapMem)
Returns a new configuration object that applies the percentages defined in this instance to the given available memory amounts.
-
-
-
Enum Constant Detail
-
READ_OPTIMIZED
public static final PredefinedMemoryRatio READ_OPTIMIZED
Memory configuration optimized for read queries. Updates should be avoided as much as possible,
-
DEFAULT
public static final PredefinedMemoryRatio DEFAULT
Memory configuration optimized for mixed workloads.
-
WRITE_OPTIMIZED
public static final PredefinedMemoryRatio WRITE_OPTIMIZED
Memory configuration optimized for updates. This mode is suitable for write-heavy applications where reads are infrequent and/or do not require much memory.
-
BULK_LOAD
public static final PredefinedMemoryRatio BULK_LOAD
Memory configuration optimized for bulk loads. This mode is suitable for bulk loading very large amounts of data (many billions of triples). After bulk loading is complete this mode should be changed back to another mode.
-
-
Method Detail
-
values
public static PredefinedMemoryRatio[] 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 (PredefinedMemoryRatio c : PredefinedMemoryRatio.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static PredefinedMemoryRatio valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
withAvailableMemory
public MemoryConfiguration withAvailableMemory(long nativeMem, long heapMem)
Returns a new configuration object that applies the percentages defined in this instance to the given available memory amounts.- Parameters:
nativeMem
- available native memory in bytes. Equivalent to java direct memory (set by MaxDirectMemorySize CLI parameter)heapMem
- available heap memory in bytes.- Returns:
- new configuration with actual memory values for each component
-
getStarrocksRatios
public com.google.common.collect.ImmutableMap<MemoryConfiguration.StarrocksComponent,java.lang.Integer> getStarrocksRatios()
-
getHeapRatios
public com.google.common.collect.ImmutableMap<MemoryConfiguration.HeapComponent,java.lang.Integer> getHeapRatios()
-
getNativeRatios
public com.google.common.collect.ImmutableMap<MemoryConfiguration.NativeComponent,java.lang.Integer> getNativeRatios()
-
setRatios
public void setRatios(java.util.Map<java.lang.String,java.lang.Object> theJsonMap)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Enum<PredefinedMemoryRatio>
-
-