Enum Class DurabilityGuarantee

java.lang.Object
java.lang.Enum<DurabilityGuarantee>
com.loomcache.server.persistence.DurabilityGuarantee
All Implemented Interfaces:
Serializable, Comparable<DurabilityGuarantee>, Constable

public enum DurabilityGuarantee extends Enum<DurabilityGuarantee>
Defines the durability guarantee level for WAL operations.

This enum controls how strictly the system enforces durability: - NONE: No persistence enforcement. Log entries are kept in-memory only. Recommended for testing/non-critical use. - WRITE: Entries must be written to disk (buffered). No fsync required. Data may be lost if there's a kernel crash or power loss, but not if the application crashes alone. - FSYNC: Entries must be written AND fsynced to disk before ACK. Strongest guarantee: data survives kernel and power failures. Highest latency cost. Recommended for critical systems.

For Raft consensus: - NONE: Fastest but unsafe. Node may lose acknowledged entries on crash. - WRITE: Moderate safety. Kernel buffers provide some protection. - FSYNC: Strongest safety (Raft standard). Every entry durable before commit.

Since:
1.0
  • Enum Constant Details

    • NONE

      public static final DurabilityGuarantee NONE
      No durability enforcement. Log entries are kept in-memory only. Fastest but least safe.
    • WRITE

      public static final DurabilityGuarantee WRITE
      Write-only durability. Entries must be written to the WAL file (page cache buffered). Provides protection against application crashes but not kernel/power failures.
    • FSYNC

      public static final DurabilityGuarantee FSYNC
      Full fsync durability (Raft standard). Entries must be written to WAL AND fsynced to disk. Provides maximum safety but with latency cost. Recommended for production Raft deployments.
  • Method Details

    • values

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