Class DSInfo


  • @Immutable
    public final class DSInfo
    extends Object
    This class holds information about a DS connected to the topology. This information is to be exchanged through the replication protocol in topology messages, to keep every member (RS or DS) of the topology aware of the DS topology.
    • Constructor Detail

      • DSInfo

        public DSInfo​(int dsId,
                      String dsUrl,
                      int rsId,
                      long generationId,
                      ServerStatus status,
                      boolean assuredFlag,
                      AssuredMode assuredMode,
                      byte safeDataLevel,
                      byte groupId,
                      Collection<String> refUrls,
                      Collection<String> eclIncludes,
                      Collection<String> eclIncludesForDeletes,
                      short protocolVersion)
        Creates a new instance of DSInfo with every given info.
        Parameters:
        dsId - The DS id
        dsUrl - Url of the DS
        rsId - The RS id the DS is connected to
        generationId - The generation id the DS is using
        status - The DS status
        assuredFlag - DS assured replication enabled or not
        assuredMode - DS assured mode
        safeDataLevel - DS safe data level
        groupId - DS group id
        refUrls - DS exported referrals URLs
        eclIncludes - The list of entry attributes to include in the ECL.
        eclIncludesForDeletes - The list of entry attributes to include in the ECL for deletes.
        protocolVersion - Protocol version supported by this server.
    • Method Detail

      • getDsId

        public int getDsId()
        Get the DS id.
        Returns:
        the DS id
      • getDsUrl

        public String getDsUrl()
        Get the DS URL.
        Returns:
        the DS URL
      • getRsId

        public int getRsId()
        Get the RS id the DS is connected to.
        Returns:
        the RS id the DS is connected to
      • getGenerationId

        public long getGenerationId()
        Get the generation id DS is using.
        Returns:
        the generation id DS is using.
      • getStatus

        public ServerStatus getStatus()
        Get the DS status.
        Returns:
        the DS status
      • isAssured

        public boolean isAssured()
        Tells if the DS has assured replication enabled.
        Returns:
        True if the DS has assured replication enabled
      • getAssuredMode

        public AssuredMode getAssuredMode()
        Get the DS assured mode (relevant if DS has assured replication enabled).
        Returns:
        The DS assured mode
      • getSafeDataLevel

        public byte getSafeDataLevel()
        Get the DS safe data level (relevant if assured mode is safe data).
        Returns:
        The DS safe data level
      • getGroupId

        public byte getGroupId()
        Get the DS group id.
        Returns:
        The DS group id
      • getRefUrls

        public List<String> getRefUrls()
        Get the DS exported URLs for referrals.
        Returns:
        The DS exported URLs for referrals
      • getEclIncludes

        public Set<String> getEclIncludes()
        Get the entry attributes to be included in the ECL.
        Returns:
        The entry attributes to be included in the ECL.
      • getEclIncludesForDeletes

        public Set<String> getEclIncludesForDeletes()
        Get the entry attributes to be included in the ECL for delete operations.
        Returns:
        The entry attributes to be included in the ECL.
      • getProtocolVersion

        public short getProtocolVersion()
        Get the protocol version supported by this server. Returns -1 when the protocol version is not known (too old version).
        Returns:
        The protocol version.
      • cloneWithReplicationServerId

        public DSInfo cloneWithReplicationServerId​(int rsId)
        Returns a new instance of DSInfo with the specified replication server Id.
        Parameters:
        rsId - the replication server Id to set on the new DSInfo object.
        Returns:
        a new instance of DSInfo with the specified replication server Id.
      • equals

        public boolean equals​(Object obj)
        Test if the passed object is equal to this one.
        Overrides:
        equals in class Object
        Parameters:
        obj - The object to test
        Returns:
        True if both objects are equal
      • hashCode

        public int hashCode()
        Computes hash code for this object instance.
        Overrides:
        hashCode in class Object
        Returns:
        Hash code for this object instance.
      • toString

        public String toString()
        Returns a string representation of the DS info.
        Overrides:
        toString in class Object
        Returns:
        A string representation of the DS info