Class Leadership


  • public class Leadership
    extends Object
    State of leadership for topic.

    Provided by this construct is the current leader and the list of nodeIds currently registered as candidates for election for the topic. Keep in mind that only registered candidates can become leaders.

    • Method Detail

      • topic

        public String topic()
        Returns the leadership topic.
        Returns:
        leadership topic.
      • leaderNodeId

        public NodeId leaderNodeId()
        Returns the nodeId of the leader.
        Returns:
        leader node identifier; will be null if there is no leader
      • leader

        public Leader leader()
        Returns the leader for this topic.
        Returns:
        leader; will be null if there is no leader for topic
      • candidates

        public List<NodeId> candidates()
        Returns an preference-ordered list of nodes that are in the leadership race for this topic.
        Returns:
        a list of NodeIds in priority-order, or an empty list.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object