Class TopologyMsg


  • public class TopologyMsg
    extends ReplicationMsg
    This class defines a message that is sent: - By a RS to the other RSs in the topology, containing: - the DSs directly connected to the RS in the DS infos - only this RS in the RS infos - By a RS to his connected DSs, containing every DSs and RSs he knows. In that case the message contains: - every DSs the RS knows except the destinator DS in the DS infos - every connected RSs (including the sending RS) in the RS infos Exchanging these messages allows to have each RS or DS take appropriate decisions according to the current topology: - a RS can route a message to a DS - a DS can decide towards which peer DS send referrals ...
    • Constructor Detail

      • TopologyMsg

        public TopologyMsg​(Collection<DSInfo> dsInfos,
                           List<RSInfo> rsInfos)
        Creates a new message of the currently connected servers.
        Parameters:
        dsInfos - The collection of currently connected DS servers ID.
        rsInfos - The list of currently connected RS servers ID.
    • Method Detail

      • getBytes

        public byte[] getBytes​(short version)
        Serializes the PDU using the provided replication protocol version. WARNING: should be overwritten by a PDU (sub class) we want to support older protocol version serialization for.
        Specified by:
        getBytes in class ReplicationMsg
        Parameters:
        version - The protocol version to use for serialization. The version should normally be older than the current one.
        Returns:
        The encoded PDU, or null if the message isn't supported in that protocol version.
      • getReplicaInfos

        public Map<Integer,​DSInfo> getReplicaInfos()
        Get the DS infos.
        Returns:
        The DS infos
      • getRsInfos

        public List<RSInfo> getRsInfos()
        Get the RS infos.
        Returns:
        The RS infos