Package org.rocksdb

Enum Class EncodingType

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

public enum EncodingType extends Enum<EncodingType>
EncodingType

The value will determine how to encode keys when writing to a new SST file.

This value will be stored inside the SST file which will be used when reading from the file, which makes it possible for users to choose different encoding type when reopening a DB. Files with different encoding types can co-exist in the same DB and can be read.

  • Enum Constant Details

    • kPlain

      public static final EncodingType kPlain
      Always write full keys without any special encoding.
    • kPrefix

      public static final EncodingType kPrefix

      Find opportunity to write the same prefix once for multiple rows. In some cases, when a key follows a previous key with the same prefix, instead of writing out the full key, it just writes out the size of the shared prefix, as well as other bytes, to save some bytes.

      When using this option, the user is required to use the same prefix extractor to make sure the same prefix will be extracted from the same key. The Name() value of the prefix extractor will be stored in the file. When reopening the file, the name of the options.prefix_extractor given will be bitwise compared to the prefix extractors stored in the file. An error will be returned if the two don't match.

  • Method Details

    • values

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