Interface LeaderElection

    • Method Detail

      • confirmLeadershipAsync

        CompletableFuture<Void> confirmLeadershipAsync​(UUID leaderSessionID,
                                                       String leaderAddress)
        Confirms that the LeaderContender has accepted the leadership identified by the given leader session id. It also publishes the leader address under which the leader is reachable.

        The data is only confirmed if the leadership is still acquired.

        The intention of this method is to establish an order between setting the new leader session ID in the LeaderContender and publishing the new leader session ID and the related leader address to the leader retrieval services.

        Parameters:
        leaderSessionID - The new leader session ID
        leaderAddress - The address of the new leader
      • hasLeadershipAsync

        CompletableFuture<Boolean> hasLeadershipAsync​(UUID leaderSessionId)
        Returns true if the service's LeaderContender has the leadership under the given leader session ID acquired.
        Parameters:
        leaderSessionId - identifying the current leader
        Returns:
        true if the associated LeaderContender is the leader, otherwise false