Class ClusterLeaderServiceCuratorImpl
java.lang.Object
com.netflix.genie.web.services.impl.ClusterLeaderServiceCuratorImpl
- All Implemented Interfaces:
ClusterLeaderService
Implementation of
ClusterLeaderService
using Spring's LeaderInitiator
(Zookeeper/Curator based
leader election mechanism).- Since:
- 4.0.0
-
Constructor Summary
ConstructorDescriptionClusterLeaderServiceCuratorImpl
(org.springframework.integration.zookeeper.leader.LeaderInitiator leaderInitiator) Constructor. -
Method Summary
-
Constructor Details
-
ClusterLeaderServiceCuratorImpl
public ClusterLeaderServiceCuratorImpl(org.springframework.integration.zookeeper.leader.LeaderInitiator leaderInitiator) Constructor.- Parameters:
leaderInitiator
- the leader initiator component
-
-
Method Details
-
stop
public void stop()Stop the service (i.e. renounce leadership and leave the election).- Specified by:
stop
in interfaceClusterLeaderService
-
start
public void start()Start the service (i.e. join the the election).- Specified by:
start
in interfaceClusterLeaderService
-
isRunning
public boolean isRunning()Whether or not this node is participating in the cluster leader election.- Specified by:
isRunning
in interfaceClusterLeaderService
- Returns:
- true if the node is participating in leader election
-
isLeader
public boolean isLeader()Whether or not this node is the current cluster leader.- Specified by:
isLeader
in interfaceClusterLeaderService
- Returns:
- true if the node is the current cluster leader
-