class

Raft::Log(T)

Inherits Reference < Object

Constructors

new(config : Config)
Source

Instance methods

append(term : UInt64, data : T | Nil = nil, entry_type : EntryType = EntryType::Normal, config_data : Bytes = Bytes.new(0)) : LogEntry(T)
Source
byte_range_for(index : UInt64) : Tuple(Int32, UInt64, UInt32) | Nil

Resolve index to {segment_fd, byte_offset, byte_length} for zero-copy senders (e.g., sendfile/splice/io_uring). Returns nil if the index has been compacted away or is past EOF.

Source
close
Source
first_index
Source
get(index : UInt64) : LogEntry(T)
Source
last_index
Source
last_term
Source
reset
Source
reset_to(index : UInt64)

Reset the log to a specific index, as after installing a snapshot. After this call, @last_index == index and the next append produces index + 1.

Source
segment_count
Source
sync
Source
term_at(index : UInt64) : UInt64
Source
truncate_after(index : UInt64)
Source
truncate_before(index : UInt64)
Source

Nested types