zookeeper

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFailedToCreateZnode        = errors.New("failed to create znode for leader election")
	ErrFailedToCheckIfZnodeExists = errors.New("failed to check if znode exists")
	ErrFailedToRetrieveChildren   = errors.New("failed to retrieve children for leader election")
	ErrorNoEligibleLeaderNodes    = errors.New("no eligible leader nodes found")
	ErrFailedToGetZnodeData       = errors.New("failed to get znode data")
)
View Source
var (
	ErrCouldNotCreatePath     = fmt.Errorf("could not create path")
	ErrCouldNotUnmarshalState = fmt.Errorf("could not unmarshal state")
	ErrCouldNotMarshalState   = fmt.Errorf("could not marshal state")
	ErrCouldNotSaveState      = fmt.Errorf("could not save state")
	ErrUnsupportedStateType   = fmt.Errorf("only CLUSTER and LOCAL state types are supported")
	ErrFailedToWatchStatePath = fmt.Errorf("failed to watch state path in zookeeper")
)

Functions

func CreateFullPath

func CreateFullPath(conn zkCreateFullPathInterface, path string, data []byte, flags int32) (string, string, error)

CreateFullPath creates a path in Zookeeper and all its parent nodes if they do not exist. If data is nil, the hostname of the current machine is used as the data. Returns the created path and the data as a string.

func NewCoordinator

func NewCoordinator(
	leaderSelector definitions.LeaderSelector,
	conn coordinatorZookeeperInterface,
	tpLeaderPath string,
	logFactory definitions.LoggerFactory,
) definitions.Coordinator

NewCoordinator creates a new Coordinator instance.

func NewStateManager added in v0.1.2

func NewStateManager(
	zkConnection localStateManagerZookeeper,
	zkPath string,
	id uuid.UUID,
) definitions.StateManager

func NewZookeeperLeaderSelector

func NewZookeeperLeaderSelector(
	conn leaderSelectorZookeeperInterface,
	znodePath string,
	logFactory definitions.LoggerFactory,
	lockName string,
) definitions.LeaderSelector

NewZookeeperLeaderSelector creates a new instance of the leader selector for Zookeeper.

Types

This section is empty.

Jump to

Keyboard shortcuts

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