Documentation ¶
Index ¶
- type LogDBCallback
- type LogDBInfo
- type LogReader
- func (lr *LogReader) Append(entries []pb.Entry) error
- func (lr *LogReader) ApplySnapshot(snapshot pb.Snapshot) error
- func (lr *LogReader) Compact(index uint64) error
- func (lr *LogReader) CreateSnapshot(snapshot pb.Snapshot) error
- func (lr *LogReader) Entries(low uint64, high uint64, maxSize uint64) ([]pb.Entry, error)
- func (lr *LogReader) GetRange() (uint64, uint64)
- func (lr *LogReader) NodeState() (pb.State, pb.Membership)
- func (lr *LogReader) SetCompactor(c pb.ICompactor)
- func (lr *LogReader) SetRange(firstIndex uint64, length uint64)
- func (lr *LogReader) SetState(s pb.State)
- func (lr *LogReader) Snapshot() pb.Snapshot
- func (lr *LogReader) Term(index uint64) (uint64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogDBCallback ¶
type LogDBCallback func(LogDBInfo)
LogDBCallback is called by the LogDB layer whenever NodeHost is required to be notified for the status change of the LogDB.
type LogReader ¶
LogReader is the struct used to manage logs that have already been persisted into LogDB. This implementation is influenced by CockroachDB's replicaRaftStorage.
func NewLogReader ¶
NewLogReader creates and returns a new LogReader instance.
func (*LogReader) Append ¶
Append marks the specified entries as persisted and make them available from logreader.
func (*LogReader) ApplySnapshot ¶
ApplySnapshot applies the specified snapshot.
func (*LogReader) CreateSnapshot ¶
CreateSnapshot keeps the metadata of the specified snapshot.
func (*LogReader) Entries ¶
Entries returns persisted entries between [low, high) with a total limit of up to maxSize bytes.
func (*LogReader) GetRange ¶
GetRange returns the index range of all logs managed by the LogReader instance.
func (*LogReader) NodeState ¶
func (lr *LogReader) NodeState() (pb.State, pb.Membership)
NodeState returns the initial state.
func (*LogReader) SetCompactor ¶
func (lr *LogReader) SetCompactor(c pb.ICompactor)
SetCompactor sets the compactor or the LogReader instance.