Interface Candidate

    • Method Detail

      • becomeLeader

        void becomeLeader​(LeaderContext ctx)
        Gets called when this candidate becomes a group leader.

        IMPORTANT: Implementations of this method should not block the calling thread for a long time and should execute all long running computations asynchronously.

        Parameters:
        ctx - Leader context.
      • becomeFollower

        void becomeFollower​(FollowerContext ctx)
        Gets called when this candidate couldn't win elections and switched to the follower state. Information about the current leader can be obtained via FollowerContext.leader().

        IMPORTANT: Implementations of this method should not block the calling thread for a long time and should execute all long running computations asynchronously.

        Parameters:
        ctx - Follower context.