Class ClusterLeaderServiceLocalLeaderImpl
- java.lang.Object
-
- com.netflix.genie.web.services.impl.ClusterLeaderServiceLocalLeaderImpl
-
- All Implemented Interfaces:
ClusterLeaderService
public class ClusterLeaderServiceLocalLeaderImpl extends java.lang.Object implements ClusterLeaderService
Implementation ofClusterLeaderService
using statically configuredLocalLeader
module.- Since:
- 4.0.0
-
-
Constructor Summary
Constructors Constructor Description ClusterLeaderServiceLocalLeaderImpl(LocalLeader localLeader)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isLeader()
Whether or not this node is the current cluster leader.boolean
isRunning()
Whether or not this node is participating in the cluster leader election.void
start()
Start the service (i.e.void
stop()
Stop the service (i.e.
-
-
-
Constructor Detail
-
ClusterLeaderServiceLocalLeaderImpl
public ClusterLeaderServiceLocalLeaderImpl(LocalLeader localLeader)
Constructor.- Parameters:
localLeader
- the local leader module
-
-
Method Detail
-
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
-
-