Class LeaderElectionActuator

java.lang.Object
com.netflix.genie.web.spring.actuators.LeaderElectionActuator

@Endpoint(id="leaderElection") public class LeaderElectionActuator extends Object
An actuator endpoint that exposes leadership status and allows stop/start/restart of the leader election service. Useful when a specific set of nodes should be given priority to win the leader election (e.g., because they are running newer code).
Since:
4.0.0
  • Constructor Details

    • LeaderElectionActuator

      public LeaderElectionActuator(ClusterLeaderService clusterLeaderService)
      Constructor.
      Parameters:
      clusterLeaderService - the cluster leader service
  • Method Details

    • getStatus

      @ReadOperation public Map<String,Object> getStatus()
      Provides the current leader service status: whether the leader service is running and whether the node is leader.
      Returns:
      a map of attributes
    • doAction

      @WriteOperation public void doAction(LeaderElectionActuator.Action action)
      Forces the node to leave the leader election, then re-join it.
      Parameters:
      action - the action to perform