Interface LeadershipAdminService


  • public interface LeadershipAdminService
    Interface for administratively manipulating leadership assignments.
    • Method Detail

      • transferLeadership

        boolean transferLeadership​(String topic,
                                   NodeId nodeId)
        Attempts to assign leadership for a topic to a specified node.
        Parameters:
        topic - leadership topic
        nodeId - identifier of the node to be made leader
        Returns:
        true is the transfer was successfully executed. This method returns false if nodeId is not one of the candidates for for the topic.
      • promoteToTopOfCandidateList

        boolean promoteToTopOfCandidateList​(String topic,
                                            NodeId nodeId)
        Make a node to be the next leader by promoting it to top of candidate list.
        Parameters:
        topic - leadership topic
        nodeId - identifier of node to be next leader
        Returns:
        true if nodeId is now the top candidate. This method returns false if nodeId is not one of the candidates for for the topic.
      • unregister

        void unregister​(NodeId nodeId)
        Removes all active leadership registrations for a given node.

        This method will also evict the node from leaderships that it currently owns.

        Parameters:
        nodeId - node identifier
      • getLeaderBoard

        Map<String,​Leadership> getLeaderBoard()
        Returns the current leader board.
        Returns:
        mapping from topic to leadership info.