Class ReplicaInfo


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

      Constructors 
      Constructor Description
      ReplicaInfo​(long term, NodeId master, java.util.List<NodeId> backups)
      Creates a ReplicaInfo instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<NodeId> backups()
      Returns the collection of NodeId, where backup copies should be placed.
      boolean equals​(java.lang.Object other)  
      int hashCode()  
      java.util.Optional<NodeId> master()
      Returns the NodeId, if there is a Node where the master copy should be.
      long term()
      Returns the mastership term.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ReplicaInfo

        public ReplicaInfo​(long term,
                           NodeId master,
                           java.util.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 java.util.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 java.util.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 java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object