Raft v0.2.1 Raft.Log.Entry

Defines a log entry struct.

Link to this section Summary

Types

The term the entry was stored in

The command or configuration data sent by the client

The index the entry is stored at. Defaults to :none. Entries are created with a :none index and the index is populated when it is appened to the log

t()

The Entry struct

Types of entries

Link to this section Types

Link to this type current_term()
current_term() :: non_neg_integer()

The term the entry was stored in.

Link to this type data()
data() :: :none | term()

The command or configuration data sent by the client.

Link to this type index()
index() :: :none | non_neg_integer()

The index the entry is stored at. Defaults to :none. Entries are created with a :none index and the index is populated when it is appened to the log.

Link to this type t()
t() :: %Raft.Log.Entry{
  data: data(),
  index: index(),
  term: current_term(),
  type: type()
}

The Entry struct.

Link to this type type()
type() :: :command | :config | :noop

Types of entries.

:command - A command sent from the client. :config - Configuration changes. :noop - Written when a leader first comes to power so that we can move the commit index forward. Since we can only commit entries from our current term based on Raft’s safety description in 5.4.2 we do this immediately in order to force a commitment based on replication. The noop is only discussed briefly in section 8. “Client Interaction”.

Link to this section Functions

Link to this function command(term, cmd)
Link to this function configuration(term, configuration)

Buids a configuration entry.

Link to this function configuration?(arg1)