Versions in this module Expand all Collapse all v3 v3.3.100 Mar 10, 2021 Changes in this version + const NoLeader + const NoNode + var ErrCompacted = errors.New("entry compacted") + var ErrSnapshotOutOfDate = errors.New("snapshot out of date") + var ErrUnavailable = errors.New("entry unavailable") + func ClusterID(clusterID uint64) string + func IsLocalMessageType(t pb.MessageType) bool + func NodeID(nodeID uint64) string + type ILogDB interface + Append func(entries []pb.Entry) error + ApplySnapshot func(ss pb.Snapshot) error + Compact func(index uint64) error + CreateSnapshot func(ss pb.Snapshot) error + Entries func(low uint64, high uint64, maxSize uint64) ([]pb.Entry, error) + GetRange func() (uint64, uint64) + NodeState func() (pb.State, pb.Membership) + SetRange func(index uint64, length uint64) + SetState func(ps pb.State) + Snapshot func() pb.Snapshot + Term func(index uint64) (uint64, error) + type LogTestHelper struct + func NewLog(logdb ILogDB) *LogTestHelper + func (l *LogTestHelper) AllEntries() []pb.Entry + func (l *LogTestHelper) Append(ents []pb.Entry) error + func (l *LogTestHelper) AppliedTo(index uint64) + func (l *LogTestHelper) CheckBound(low uint64, high uint64) error + func (l *LogTestHelper) Entries(start uint64, maxsize uint64) ([]pb.Entry, error) + func (l *LogTestHelper) EntriesToApply() []pb.Entry + func (l *LogTestHelper) EntriesToSave() []pb.Entry + func (l *LogTestHelper) FirstIndex() uint64 + func (l *LogTestHelper) GetCommitted() uint64 + func (l *LogTestHelper) GetConflictIndex(ents []pb.Entry) uint64 + func (l *LogTestHelper) GetEntries(low uint64, high uint64, maxsize uint64) ([]pb.Entry, error) + func (l *LogTestHelper) HasEntriesToApply() bool + func (l *LogTestHelper) LastIndex() uint64 + func (l *LogTestHelper) MatchTerm(index uint64, term uint64) bool + func (l *LogTestHelper) SetCommitted(v uint64) + func (l *LogTestHelper) Term(index uint64) (uint64, error) + func (l *LogTestHelper) TryAppend(index uint64, logTerm uint64, committed uint64, ents []pb.Entry) (uint64, bool) + func (l *LogTestHelper) TryCommit(index uint64, term uint64) bool + func (l *LogTestHelper) UnstableOffset() uint64 + func (l *LogTestHelper) UpToDate(index uint64, term uint64) bool + type Peer struct + func Launch(config config.Config, logdb ILogDB, events server.IRaftEventListener, ...) *Peer + func (p *Peer) ApplyConfigChange(cc pb.ConfigChange) + func (p *Peer) Commit(ud pb.Update) + func (p *Peer) GetUpdate(moreToApply bool, lastApplied uint64) pb.Update + func (p *Peer) Handle(m pb.Message) + func (p *Peer) HasEntryToApply() bool + func (p *Peer) HasUpdate(moreToApply bool) bool + func (p *Peer) NotifyRaftLastApplied(lastApplied uint64) + func (p *Peer) ProposeConfigChange(configChange pb.ConfigChange, key uint64) + func (p *Peer) ProposeEntries(ents []pb.Entry) + func (p *Peer) QuiescedTick() + func (p *Peer) RateLimited() bool + func (p *Peer) ReadIndex(ctx pb.SystemCtx) + func (p *Peer) RejectConfigChange() + func (p *Peer) ReportSnapshotStatus(nodeID uint64, reject bool) + func (p *Peer) ReportUnreachableNode(nodeID uint64) + func (p *Peer) RequestLeaderTransfer(target uint64) + func (p *Peer) RestoreRemotes(ss pb.Snapshot) + func (p *Peer) Tick() + type PeerAddress struct + Address string + NodeID uint64 + type State uint64 + func (st State) String() string + type Status struct + Applied uint64 + ClusterID uint64 + LeaderID uint64 + NodeID uint64 + NodeState State + func (s *Status) IsFollower() bool + func (s *Status) IsLeader() bool Other modules containing this package github.com/ik-tech/dragonboat