Enum Class DurabilityGuarantee
- All Implemented Interfaces:
Serializable, Comparable<DurabilityGuarantee>, Constable
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
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic DurabilityGuaranteeReturns the enum constant of this class with the specified name.static DurabilityGuarantee[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
No durability enforcement. Log entries are kept in-memory only. Fastest but least safe. -
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
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
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
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 nameNullPointerException- if the argument is null
-