Package org.rocksdb

Enum Class WALRecoveryMode

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

public enum WALRecoveryMode extends Enum<WALRecoveryMode>
The WAL Recover Mode
  • Enum Constant Details

    • TolerateCorruptedTailRecords

      public static final WALRecoveryMode TolerateCorruptedTailRecords
      Original levelDB recovery

      We tolerate incomplete record in trailing data on all logs Use case : This is legacy behavior (default)

    • AbsoluteConsistency

      public static final WALRecoveryMode AbsoluteConsistency
      Recover from clean shutdown

      We don't expect to find any corruption in the WAL Use case : This is ideal for unit tests and rare applications that can require high consistency guarantee

    • PointInTimeRecovery

      public static final WALRecoveryMode PointInTimeRecovery
      Recover to point-in-time consistency We stop the WAL playback on discovering WAL inconsistency Use case : Ideal for systems that have disk controller cache like hard disk, SSD without super capacitor that store related data
    • SkipAnyCorruptedRecords

      public static final WALRecoveryMode SkipAnyCorruptedRecords
      Recovery after a disaster We ignore any corruption in the WAL and try to salvage as much data as possible Use case : Ideal for last ditch effort to recover data or systems that operate with low grade unrelated data
  • Method Details

    • values

      public static WALRecoveryMode[] 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 WALRecoveryMode 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
    • getWALRecoveryMode

      public static WALRecoveryMode getWALRecoveryMode(byte byteIdentifier)

      Get the WALRecoveryMode enumeration value by passing the byte identifier to this method.

      Parameters:
      byteIdentifier - of WALRecoveryMode.
      Returns:
      WALRecoveryMode instance.
      Throws:
      IllegalArgumentException - If WALRecoveryMode cannot be found for the provided byteIdentifier