Documentation
¶
Index ¶
- Variables
- func CreateFullPath(conn *zk.Conn, path string, data []byte, flags int32) (string, string, error)
- func NewCoordinator(leaderSelector definitions.LeaderSelector, conn *zk.Conn, tpLeaderPath string, ...) definitions.Coordinator
- func NewZookeeperLeaderSelector(conn *zk.Conn, znodePath string, log *logrus.Logger, lockName string) definitions.LeaderSelector
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 ¶
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.
Click to show internal directories.
Click to hide internal directories.