package log
- Alphabetic
- Public
- All
Type Members
- final case class AttemptToAppendLogEntryAtEarlierTerm(attemptedEntry: LogCoords, latestLogEntryAppended: LogCoords) extends Exception with LogAppendResult with NoStackTrace with Product with Serializable
- final case class AttemptToSkipLogEntry(attemptedLogEntry: LogCoords, expectedNextIndex: LogIndex) extends Exception with LogAppendResult with NoStackTrace with Product with Serializable
-
case class
CachingLog[A](underlying: RaftLog[A]) extends DelegateLog[A] with Product with Serializable
Wraps a log by keeping in memory the latest commit/append index
Wraps a log by keeping in memory the latest commit/append index
- underlying
the underlying log
- trait DelegateLog[A] extends RaftLog[A]
- trait FileBasedLog[T] extends RaftLog[T]
-
class
InMemory[T] extends BaseLog[T]
An in-memory persistent log.
An in-memory persistent log. Not a great idea for production, but nifty for testing
- sealed trait LogAppendResult extends AnyRef
-
final
case class
LogAppendSuccess(firstIndex: LogCoords, lastIndex: LogCoords, replacedLogCoords: Seq[LogCoords] = Nil) extends LogAppendResult with Product with Serializable
Represents the return type of a file-based raft log
Represents the return type of a file-based raft log
- firstIndex
the first index written
- lastIndex
the last index written
- replacedLogCoords
in the case where a disconnected leader had accepted commits, these are the coordinates of replaced entries which had been appended (but not committed) from an out-of-date leader
-
final
case class
LogCoords(term: Term, index: LogIndex) extends Product with Serializable
Represents the coords of a log entry
- final case class LogEntry[T](term: Term, data: T) extends Product with Serializable
- final case class LogState(commitIndex: LogIndex, latestTerm: Term, latestIndex: LogIndex) extends Product with Serializable
- final case class NotTheLeaderException(attemptedNodeId: NodeId, term: Term, leadIdOpt: Option[NodeId]) extends Exception with LogAppendResult with NoStackTrace with Product with Serializable
-
trait
RaftLog[A] extends RaftLogOps[A]
The persistent log
-
trait
RaftLogOps[A] extends AnyRef
A base type for the raft log.
A base type for the raft log.
the RaftLogOps#onCommit is the primary, important bit which binds the commit of the log entry to your application. That is the point where the entry is applied to your state-machine.
The 'RaftLogOps' is declared from which RaftLog extends, as the JVM-specific implemenation uses the 'RaftLog' companion object with its dependency on the 'ToBytes'/'FromBytes' typeclasses, which as I write this, I realize how silly a reason that perhaps is to split it up.
At any rate, the end-client consumers of this trait won't know, as both the JVM and Javascript variants expose a RaftLog, so it shouldn't really impact anybody, other than to give 'em pause as they think "why this extra step in the class hierarchy?"
- A
the type stored in the log
-
class
StateMachineLog[A] extends DelegateLog[A]
Invokes a function when log entries are committed
Value Members
- object FileBasedLog extends LowPriorityIOImplicits
- object LogAppendResult
- object LogCoords extends Serializable
- object LogState extends Serializable
- object RaftLog
- object StateMachineLog