Class ClusterLeaderServiceCuratorImpl
- java.lang.Object
-
- com.netflix.genie.web.services.impl.ClusterLeaderServiceCuratorImpl
-
- All Implemented Interfaces:
ClusterLeaderService
public class ClusterLeaderServiceCuratorImpl extends java.lang.Object implements ClusterLeaderService
Implementation ofClusterLeaderServiceusing Spring'sLeaderInitiator(Zookeeper/Curator based leader election mechanism).- Since:
- 4.0.0
-
-
Constructor Summary
Constructors Constructor Description ClusterLeaderServiceCuratorImpl(org.springframework.integration.zookeeper.leader.LeaderInitiator leaderInitiator)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisLeader()Whether or not this node is the current cluster leader.booleanisRunning()Whether or not this node is participating in the cluster leader election.voidstart()Start the service (i.e.voidstop()Stop the service (i.e.
-
-
-
Method Detail
-
stop
public void stop()
Stop the service (i.e. renounce leadership and leave the election).- Specified by:
stopin interfaceClusterLeaderService
-
start
public void start()
Start the service (i.e. join the the election).- Specified by:
startin interfaceClusterLeaderService
-
isRunning
public boolean isRunning()
Whether or not this node is participating in the cluster leader election.- Specified by:
isRunningin 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:
isLeaderin interfaceClusterLeaderService- Returns:
- true if the node is the current cluster leader
-
-