LogEntry

@Serializable
data class LogEntry(val index: Long, val term: Long, val command: ByteArray, val isNoOp: Boolean = false, val config: ConfigPayload? = null, val dedupKey: DedupKey? = null)

One entry in the replicated Raft log.

Parameters

index

1-based, monotonically increasing position in the log. The log is contiguous — there are no gaps between consecutive entries.

term

The leader's term when this entry was appended. Term numbers increase monotonically across the cluster's lifetime.

command

Opaque application bytes. The Raft layer treats this as an uninterpreted blob; the application gives command meaning after the entry appears on RaftNode.committed. An application may legitimately propose an empty command — emptiness alone does not mark an entry internal (see isNoOp).

isNoOp

true only for the internal §5.4.2 election no-op a new leader appends so prior-term entries can advance commitIndex. No-ops are real log entries (replicated and persisted) but are not application data, so they are withheld from RaftNode.committed. Application-proposed entries always have isNoOp == false, even when their command is empty.

config

Non-null only for internal membership-change entries (§6 joint consensus). Like isNoOp, config entries are replicated and persisted but withheld from RaftNode.committed — they carry cluster membership, not application data. A null value means this is a normal application entry.

dedupKey

The Raft §8 client-serial dedup identity stamped by the proposer. Non-null for stamped application entries; null for internal no-op/config entries and for legacy entries decoded before this field existed.

Constructors

Link copied to clipboard
constructor(index: Long, term: Long, command: ByteArray, isNoOp: Boolean = false, config: ConfigPayload? = null, dedupKey: DedupKey? = null)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val index: Long
Link copied to clipboard
Link copied to clipboard
val term: Long

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int