mastership

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 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 device.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

	// GetMastership returns the mastership for a given device
	GetMastership(id device.ID) (*Mastership, error)

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

Store is the device mastership 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 mastership term

Jump to

Keyboard shortcuts

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