Package

miniraft

Permalink

package miniraft

Visibility
  1. Public
  2. All

Type Members

  1. case class AppendEntries[T](term: Term, leaderId: NodeId, commitIndex: LogIndex, prevLogIndex: LogIndex, prevLogTerm: Term, entry: Option[T]) extends RaftRequest with Product with Serializable

    Permalink

    The first request sent should be commitIndex: 0 prevIndex : 0 prevTerm : 0

    The first request sent should be commitIndex: 0 prevIndex : 0 prevTerm : 0

    (to which the initial response would be) matchIndex: 1 // the most recent uncommitted index

    The next request would be:

    commmitIndex : 1 prevIndex : 1 // the recipient's match index prevTerm : 2 // the first term which has a leader

    term

    our (the leader's) term

    leaderId

    our (the leader's) id

    commitIndex

    the index this commit is for.

    prevLogIndex

    the last known (or assumed) index as we know it. If the receiver replies w/ a non-success response, this index is decremented and retried

    prevLogTerm

    the term of the log index

    entry

    the entry to append ... which are only non-empty if a previous AppendEntries request came back successfully

  2. case class AppendEntriesResponse(term: Term, success: Boolean, matchIndex: LogIndex) extends RaftResponse with Product with Serializable

    Permalink
  3. trait LeaderApi[T] extends AnyRef

    Permalink
  4. trait RaftEndpoint[T] extends AnyRef

    Permalink

    A generic representatino of a raft node -- simply something which can respond to RaftRequest messages

  5. sealed trait RaftRequest extends AnyRef

    Permalink
  6. sealed trait RaftResponse extends AnyRef

    Permalink
  7. case class RequestVote(term: Term, candidateId: NodeId, lastLogIndex: LogIndex, lastLogTerm: Term) extends RaftRequest with Product with Serializable

    Permalink

    TODO - add our latest commit (applied) index

    TODO - add our latest commit (applied) index

    lastLogIndex

    our latest log index

  8. case class RequestVoteResponse(term: Term, granted: Boolean) extends RaftResponse with Product with Serializable

    Permalink
  9. trait UpdateResponse extends AnyRef

    Permalink

    Provides a means to keep track of all the 'append entries' responses received for a given end-user (client) request.

    Provides a means to keep track of all the 'append entries' responses received for a given end-user (client) request. The 'result' can be used to finally reply to the user request as it completes when a quorum of results confirms (or denies) the success of the update

Value Members

  1. object RaftEndpoint

    Permalink
  2. object UpdateResponse

    Permalink
  3. package state

    Permalink

Ungrouped