zookeeper

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: MIT Imports: 13 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")
)

Functions

func CreateFullPath

func CreateFullPath(conn *zk.Conn, 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 *zk.Conn, tpLeaderPath string, log *logrus.Logger) definitions.Coordinator

NewCoordinator creates a new Coordinator instance.

func NewZookeeperLeaderSelector

func NewZookeeperLeaderSelector(conn *zk.Conn, znodePath string, log *logrus.Logger, 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