Class SiteMaster

  • All Implemented Interfaces:
    java.lang.Comparable<Address>, Address, Constructable<UUID>, SiteAddress, SizeStreamable, Streamable

    public class SiteMaster
    extends SiteUUID
    Special address with the UUID part being 0: identifies the current (relay) coordinator of a given site. E,g, if we send a message with dest=SiteMaster(SFO) from site LON, then the message will be forwarded to the relay coordinator of the SFO site
    Since:
    3.2
    Author:
    Bela Ban
    • Field Detail

      • ALL_SMS

        protected static final SiteMaster ALL_SMS
      • HASH

        protected static final int HASH
    • Constructor Detail

      • SiteMaster

        public SiteMaster()
      • SiteMaster

        public SiteMaster​(java.lang.String site)
    • Method Detail

      • create

        public java.util.function.Supplier<? extends UUID> create()
        Description copied from interface: Constructable
        Creates an instance of the class implementing this interface
        Specified by:
        create in interface Constructable<UUID>
        Overrides:
        create in class SiteUUID
      • isMulticast

        public boolean isMulticast()
        Description copied from interface: Address
        Whether or not this address causes a message to be sent to mulitple members. Typically, 'null' as destination sends the message to all members of a cluster, and a non-null address sends it to a single member. However, if a non-null destination address causes multicast behavior, this method needs to return true.
        Returns:
        True if a message with this address as destination is sent to multiple members, else false
      • isSiteMaster

        public boolean isSiteMaster()
        Description copied from interface: Address
        Whether or not this address is a SiteMaster. Kludgey workaround to avoid the use of instanceof SiteMaster.
        Will be removed once the type pollution issue (https://bugs.openjdk.org/browse/JDK-8180450) is fixed.
        Returns:
        true if this address is a site master, false otherwise
      • compareTo

        public int compareTo​(Address other)
        Description copied from class: UUID
        Compares this UUID with the specified UUID.

        The first of two UUIDs is greater than the second if the most significant field in which the UUIDs differ is greater for the first UUID.

        Specified by:
        compareTo in interface java.lang.Comparable<Address>
        Overrides:
        compareTo in class SiteUUID
        Parameters:
        other - UUID to which this UUID is to be compared
        Returns:
        -1, 0 or 1 as this UUID is less than, equal to, or greater than val
      • equals

        public boolean equals​(java.lang.Object obj)
        Description copied from class: UUID
        Compares this object to the specified object. The result is true if and only if the argument is not null, is a UUID object, has the same variant, and contains the same value, bit for bit, as this UUID.
        Overrides:
        equals in class SiteUUID
        Parameters:
        obj - The object to be compared
        Returns:
        true if the objects are the same; false otherwise
      • hashCode

        public int hashCode()
        Description copied from class: UUID
        Returns a hash code for this UUID.
        Overrides:
        hashCode in class SiteUUID
        Returns:
        A hash code value for this UUID
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class SiteUUID