Enum Class SyncMode
- All Implemented Interfaces:
Serializable,Comparable<SyncMode>,Constable
The durability mode a
TinkerStorage engine applies when flushing a committed transaction to disk, selected
with the gremlin.tinkergraph.storage.sync configuration key. Each value is a complete, mutually-exclusive
choice; they are ordered from strongest to weakest durability.
The name of a mode describes when data is made durable, not what action is taken: COMMIT
performs an fsync so acknowledged commits survive an OS crash or power loss, whereas OS only pushes
bytes into the operating system's page cache, so commits survive a crash of the JVM process but not of the OS.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
-
Enum Constant Details
-
COMMIT
fsyncon every commit. An acknowledged commit is durable against process crash, OS crash, and power loss. This is the default and the mode that honors the "each committed transaction is durably written to disk" contract. -
OS
Flush to the operating system on every commit, but do notfsync. An acknowledged commit survives a crash of the JVM process but may be lost on an OS crash or power loss, since the data can still be sitting in the OS page cache. Faster thanCOMMIT; use only when that weaker guarantee is acceptable.
-
-
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
-
fromConfigValue
Resolve a configuration value to aSyncMode, matched case-insensitively, defaulting toCOMMITwhen unset.- Parameters:
configValue- the raw configuration value, ornullwhen unset- Returns:
- the resolved mode
- Throws:
IllegalArgumentException- if the value does not name a known mode
-