Package com.complexible.common.memory
Enum Class PredefinedMemoryRatio
- All Implemented Interfaces:
Serializable,Comparable<PredefinedMemoryRatio>,Constable
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 the
withAvailableMemory(long, long) function.- Since:
- 5.0
- Version:
- 5.0
- Author:
- Evren
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionMemory configuration optimized for bulk loads.Memory configuration optimized for mixed workloads.Memory configuration optimized for read queries.Memory configuration optimized for updates. -
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.collect.ImmutableMap<MemoryConfiguration.HeapComponent, Integer> com.google.common.collect.ImmutableMap<MemoryConfiguration.NativeComponent, Integer> com.google.common.collect.ImmutableMap<MemoryConfiguration.StarrocksComponent, Integer> voidtoString()static PredefinedMemoryRatioReturns the enum constant of this class with the specified name.static PredefinedMemoryRatio[]values()Returns an array containing the constants of this enum class, in the order they are declared.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 Details
-
READ_OPTIMIZED
Memory configuration optimized for read queries. Updates should be avoided as much as possible, -
DEFAULT
Memory configuration optimized for mixed workloads. -
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
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 Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
withAvailableMemory
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,Integer> getStarrocksRatios() -
getHeapRatios
public com.google.common.collect.ImmutableMap<MemoryConfiguration.HeapComponent,Integer> getHeapRatios() -
getNativeRatios
public com.google.common.collect.ImmutableMap<MemoryConfiguration.NativeComponent,Integer> getNativeRatios() -
setRatios
-
toString
- Overrides:
toStringin classEnum<PredefinedMemoryRatio>
-