Package org.rocksdb

Enum CompactionPriority

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<CompactionPriority>

    public enum CompactionPriority
    extends java.lang.Enum<CompactionPriority>
    Compaction Priorities
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      ByCompensatedSize
      Slightly Prioritize larger files by size compensated by #deletes
      MinOverlappingRatio
      First compact files whose ratio between overlapping size in next level and its size is the smallest.
      OldestLargestSeqFirst
      First compact files whose data's latest update time is oldest.
      OldestSmallestSeqFirst
      First compact files whose range hasn't been compacted to the next level for the longest.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static CompactionPriority getCompactionPriority​(byte value)
      Get CompactionPriority by byte value.
      byte getValue()
      Returns the byte value of the enumerations value
      static CompactionPriority valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static CompactionPriority[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • 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.
    • Method Detail

      • values

        public static CompactionPriority[] 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 (CompactionPriority c : CompactionPriority.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static CompactionPriority 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 name
        java.lang.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:
        java.lang.IllegalArgumentException - if an invalid value is provided.