Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Epoch config.TestEpoch ID uint64 Peers []raft.Peer SelfAddr string PeerAddrs map[uint64]string }
Config contains configurations for constructing a Peer.
type Peer ¶
type Peer struct {
// contains filtered or unexported fields
}
Peer is a member of a Raft consensus group. Its primary roles are to: 1. route incoming Raft messages 2. periodically tick the Raft RawNode 3. serve as a scheduler for Raft proposal pipeline events
func (*Peer) Campaign ¶
func (p *Peer) Campaign()
Campaign causes the Peer to transition to the candidate state and attempt to acquire Raft leadership.
func (*Peer) HandleMessage ¶
HandleMessage implements transport.RaftHandler.
func (*Peer) ProposeWith ¶
func (p *Peer) ProposeWith(enc proposal.EncProposal, c chan bool) bool
ProposeWith proposes the provided encoded update to the Raft state machine. Channel c is expected to have a capacity of 1.
func (*Peer) Stop ¶
func (p *Peer) Stop()
Stop stops all processing and releases all resources held by Peer.
func (*Peer) WaitForAllCaughtUp ¶
func (p *Peer) WaitForAllCaughtUp()
WaitForAllCaughtUp waits for all peers to catch up to the same log index.