Enum Class PredefinedMemoryRatio

java.lang.Object
java.lang.Enum<PredefinedMemoryRatio>
com.complexible.common.memory.PredefinedMemoryRatio
All Implemented Interfaces:
Serializable, Comparable<PredefinedMemoryRatio>, Constable

public enum PredefinedMemoryRatio extends 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 the withAvailableMemory(long, long) function.
Since:
5.0
Version:
5.0
Author:
Evren
  • Enum Constant Details

    • 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 Details

    • values

      public static PredefinedMemoryRatio[] 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

      public static PredefinedMemoryRatio valueOf(String name)
      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 name
      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,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

      public void setRatios(Map<String,Object> theJsonMap)
    • toString

      public String toString()
      Overrides:
      toString in class Enum<PredefinedMemoryRatio>