java.lang.Object
java.lang.Enum<SyncMode>
org.apache.tinkerpop.gremlin.tinkergraph.structure.storage.SyncMode
All Implemented Interfaces:
Serializable, Comparable<SyncMode>, Constable

public enum SyncMode extends Enum<SyncMode>
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.

  • Enum Constant Details

    • COMMIT

      public static final SyncMode COMMIT
      fsync on 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

      public static final SyncMode OS
      Flush to the operating system on every commit, but do not fsync. 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 than COMMIT; use only when that weaker guarantee is acceptable.
  • Method Details

    • values

      public static SyncMode[] 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 SyncMode 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
    • fromConfigValue

      public static SyncMode fromConfigValue(String configValue)
      Resolve a configuration value to a SyncMode, matched case-insensitively, defaulting to COMMIT when unset.
      Parameters:
      configValue - the raw configuration value, or null when unset
      Returns:
      the resolved mode
      Throws:
      IllegalArgumentException - if the value does not name a known mode