Documentation
¶
Index ¶
- Variables
- func CreateFullPath(conn zkCreateFullPathInterface, path string, data []byte, flags int32) (string, string, error)
- func NewCoordinator(leaderSelector definitions.LeaderSelector, conn coordinatorZookeeperInterface, ...) definitions.Coordinator
- func NewStateManager(zkConnection localStateManagerZookeeper, zkPath string, id uuid.UUID) definitions.StateManager
- func NewZookeeperLeaderSelector(conn leaderSelectorZookeeperInterface, znodePath 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") )
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.
Click to show internal directories.
Click to hide internal directories.