Module raft::storage

source ·
Expand description

Represents the storage trait and example implementation.

The storage trait is used to house and eventually serialize the state of the system. Custom implementations of this are normal and this is likely to be a key integration point for your distributed storage.

Structs

  • Records the context of the caller who calls entries() of Storage trait.
  • MemStorage is a thread-safe but incomplete implementation of Storage, mainly for tests.
  • The Memory Storage Core instance holds the actual state of the storage struct. To access this value, use the rl and wl functions on the main MemStorage implementation.
  • Holds both the hard state (commit index, vote leader, term) and the configuration state (Current node IDs)

Traits

  • Storage saves all the information about the current Raft implementation, including Raft Log, commit index, the leader to vote for, etc.