mastership

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mastership

type Mastership struct {
	// Device is the identifier of the device to which this mastership related
	Device topodevice.ID

	// Term is the mastership term
	Term Term

	// Master is the NodeID of the master for the device
	Master cluster.NodeID
}

Mastership contains information about a device mastership term

type Store

type Store interface {
	io.Closer

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

	// IsMaster returns a boolean indicating whether the local node is the master for the given device
	IsMaster(id topodevice.ID) (bool, error)

	// Watch watches the store for mastership changes
	Watch(topodevice.ID, chan<- Mastership) error
}

Store is the device mastership store

func NewAtomixStore

func NewAtomixStore(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 mastership term

Jump to

Keyboard shortcuts

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