Package org.rocksdb

Enum Class CompactionPriority

java.lang.Object
java.lang.Enum<CompactionPriority>
org.rocksdb.CompactionPriority
All Implemented Interfaces:
Serializable, Comparable<CompactionPriority>, Constable

public enum CompactionPriority extends Enum<CompactionPriority>
Compaction Priorities
  • Enum Constant Details

    • ByCompensatedSize

      public static final CompactionPriority ByCompensatedSize
      Slightly Prioritize larger files by size compensated by #deletes
    • OldestLargestSeqFirst

      public static final CompactionPriority OldestLargestSeqFirst
      First compact files whose data's latest update time is oldest. Try this if you only update some hot keys in small ranges.
    • OldestSmallestSeqFirst

      public static final CompactionPriority OldestSmallestSeqFirst
      First compact files whose range hasn't been compacted to the next level for the longest. If your updates are random across the key space, write amplification is slightly better with this option.
    • MinOverlappingRatio

      public static final CompactionPriority MinOverlappingRatio
      First compact files whose ratio between overlapping size in next level and its size is the smallest. It in many cases can optimize write amplification.
    • RoundRobin

      public static final CompactionPriority RoundRobin
      Keeps a cursor(s) of the successor of the file (key range) was/were compacted before, and always picks the next files (key range) in that level. The file picking process will cycle through all the files in a round-robin manner.
  • Method Details

    • values

      public static CompactionPriority[] 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 CompactionPriority 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
    • getValue

      public byte getValue()
      Returns the byte value of the enumerations value
      Returns:
      byte representation
    • getCompactionPriority

      public static CompactionPriority getCompactionPriority(byte value)
      Get CompactionPriority by byte value.
      Parameters:
      value - byte representation of CompactionPriority.
      Returns:
      CompactionPriority instance or null.
      Throws:
      IllegalArgumentException - if an invalid value is provided.