Class ReplicaInfo


  • public final class ReplicaInfo
    extends Object
    Class to represent placement information about Master/Backup copy.
    • Constructor Detail

      • ReplicaInfo

        public ReplicaInfo​(long term,
                           NodeId master,
                           List<NodeId> backups)
        Creates a ReplicaInfo instance.
        Parameters:
        term - monotonically increasing unique mastership term
        master - NodeId of the node where the master copy should be
        backups - list of NodeId, where backup copies should be placed
    • Method Detail

      • term

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

        public Optional<NodeId> master()
        Returns the NodeId, if there is a Node where the master copy should be.
        Returns:
        NodeId, where the master copy should be placed
      • backups

        public List<NodeId> backups()
        Returns the collection of NodeId, where backup copies should be placed.
        Returns:
        collection of NodeId, where backup copies should be placed
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object