kubernetes/vendor/go.etcd.io/etcd/raft/v3/node.go

type SnapshotStatus

const SnapshotFinish

const SnapshotFailure

var emptyState

var ErrStopped

type SoftState

func (a *SoftState) equal(b *SoftState) bool {}

type Ready

func isHardStateEqual(a, b pb.HardState) bool {}

// IsEmptyHardState returns true if the given HardState is empty.
func IsEmptyHardState(st pb.HardState) bool {}

// IsEmptySnap returns true if the given Snapshot is empty.
func IsEmptySnap(sp pb.Snapshot) bool {}

func (rd Ready) containsUpdates() bool {}

// appliedCursor extracts from the Ready the highest index the client has
// applied (once the Ready is confirmed via Advance). If no information is
// contained in the Ready, returns zero.
func (rd Ready) appliedCursor() uint64 {}

type Node

type Peer

// StartNode returns a new Node given configuration and a list of raft peers.
// It appends a ConfChangeAddNode entry for each given peer to the initial log.
//
// Peers must not be zero length; call RestartNode in that case.
func StartNode(c *Config, peers []Peer) Node {}

// RestartNode is similar to StartNode but does not take a list of peers.
// The current membership of the cluster will be restored from the Storage.
// If the caller has an existing state machine, pass in the last log index that
// has been applied to it; otherwise use zero.
func RestartNode(c *Config) Node {}

type msgWithResult

type node

func newNode(rn *RawNode) node {}

func (n *node) Stop() {}

func (n *node) run() {}

// Tick increments the internal logical clock for this Node. Election timeouts
// and heartbeat timeouts are in units of ticks.
func (n *node) Tick() {}

func (n *node) Campaign(ctx context.Context) error {}

func (n *node) Propose(ctx context.Context, data []byte) error {}

func (n *node) Step(ctx context.Context, m pb.Message) error {}

func confChangeToMsg(c pb.ConfChangeI) (pb.Message, error) {}

func (n *node) ProposeConfChange(ctx context.Context, cc pb.ConfChangeI) error {}

func (n *node) step(ctx context.Context, m pb.Message) error {}

func (n *node) stepWait(ctx context.Context, m pb.Message) error {}

// Step advances the state machine using msgs. The ctx.Err() will be returned,
// if any.
func (n *node) stepWithWaitOption(ctx context.Context, m pb.Message, wait bool) error {}

func (n *node) Ready() <-chan Ready {}

func (n *node) Advance() {}

func (n *node) ApplyConfChange(cc pb.ConfChangeI) *pb.ConfState {}

func (n *node) Status() Status {}

func (n *node) ReportUnreachable(id uint64) {}

func (n *node) ReportSnapshot(id uint64, status SnapshotStatus) {}

func (n *node) TransferLeadership(ctx context.Context, lead, transferee uint64) {}

func (n *node) ReadIndex(ctx context.Context, rctx []byte) error {}

func newReady(r *raft, prevSoftSt *SoftState, prevHardSt pb.HardState) Ready {}

// MustSync returns true if the hard state and count of Raft entries indicate
// that a synchronous write to persistent storage is required.
func MustSync(st, prevst pb.HardState, entsnum int) bool {}