leadership

package
v0.7.23 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Leadership

type Leadership struct {
	// Term is the leadership term
	Term Term

	// Leader is the NodeID of the leader
	Leader cluster.NodeID
}

Leadership contains information about a leadership term

type Store

type Store interface {
	io.Closer

	// NodeID returns the local node identifier used in the election
	NodeID() cluster.NodeID

	// IsLeader returns a boolean indicating whether the local node is the leader
	IsLeader() (bool, error)

	// Watch watches the store for changes
	Watch(chan<- Leadership) error
}

Store is the cluster wide leadership store

func NewAtomixStore

func NewAtomixStore(cluster cluster.Cluster, config config.Config) (Store, error)

NewAtomixStore returns a new persistent Store

func NewLocalStore

func NewLocalStore(clusterID string, nodeID cluster.NodeID) (Store, error)

NewLocalStore returns a new local election store

type Term

type Term uint64

Term is a monotonically increasing leadership term

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL