Class MastershipInfo


  • public final class MastershipInfo
    extends Object
    Mastership info.
    • Constructor Detail

      • MastershipInfo

        public MastershipInfo()
    • Method Detail

      • term

        public long term()
        Returns the mastership term.
        Returns:
        the mastership term
      • master

        public Optional<NodeId> master()
        Returns the current master.
        Returns:
        the current master
      • backups

        public List<NodeId> backups()
        Returns a sorted list of standby nodes.
        Returns:
        a sorted list of standby nodes
      • getRoles

        public List<NodeId> getRoles​(MastershipRole role)
        Returns the list of nodes with the given role.
        Parameters:
        role - the role by which to filter nodes
        Returns:
        an immutable list of nodes with the given role sorted in priority order
      • getRole

        public MastershipRole getRole​(NodeId nodeId)
        Returns the current role for the given node.
        Parameters:
        nodeId - the node for which to return the current role
        Returns:
        the current role for the given node
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object