Class RoutableMsg

  • Direct Known Subclasses:
    DoneMsg, EntryMsg, ErrorMsg, InitializeRcvAckMsg, InitializeRequestMsg, InitializeTargetMsg

    public abstract class RoutableMsg
    extends ReplicationMsg
    This is an abstract class of messages of the replication protocol for message that needs to contain information about the server that send them and the destination servers to which they should be sent.

    Routable messages are used when initializing a new replica from an existing replica: the total update messages are sent across the topology from the source replica to the target replica, possibly traversing one or two replication servers in the process (e.g. DS1 -> RS1 -> RS2 -> DS2).

    • Field Detail

      • UNKNOWN_SERVER

        public static final int UNKNOWN_SERVER
        Specifies that no server is identified.
        See Also:
        Constant Field Values
      • ALL_SERVERS

        public static final int ALL_SERVERS
        Specifies all servers in the replication domain.
        See Also:
        Constant Field Values
      • THE_CLOSEST_SERVER

        public static final int THE_CLOSEST_SERVER
        Inside a topology of servers in the same domain, it specifies the server that is the "closest" to the sender.
        See Also:
        Constant Field Values
      • destination

        protected int destination
        The destination server or servers of this message.
      • senderID

        protected int senderID
        The serverID of the server that sends this message.
    • Constructor Detail

      • RoutableMsg

        public RoutableMsg​(int serverID,
                           int destination)
        Creates a routable message.
        Parameters:
        serverID - replication server id
        destination - replication server id
      • RoutableMsg

        public RoutableMsg()
        Creates a routable message.
    • Method Detail

      • getDestination

        public int getDestination()
        Get the destination. The value is a serverId, or ALL_SERVERS dedicated value.
        Returns:
        the destination
      • getSenderID

        public int getSenderID()
        Get the server ID of the server that sent this message.
        Returns:
        the server id