Class PING

  • All Implemented Interfaces:
    Lifecycle
    Direct Known Subclasses:
    BPING, MPING

    public class PING
    extends Discovery
    The PING protocol retrieves the initial membership by mcasting a discovery request (via the multicast capable transport) to all current cluster members

    The responses should allow us to determine the coordinator which we have to contact, e.g. in case we want to join the group. When we are a server (after having received the BECOME_SERVER event), we'll respond to discovery requests with a discovery response.

    Author:
    Bela Ban
    • Constructor Detail

      • PING

        public PING()
    • Method Detail

      • findMembers

        public void findMembers​(java.util.List<Address> members,
                                boolean initial_discovery,
                                Responses responses)
        Description copied from class: Discovery
        Fetches information (e.g. physical address, logical name) for the given member addresses. Needs to add responses to the Responses object. If Discovery.async_discovery is true, this method will be called in a separate thread, otherwise the caller's thread will be used.
        Specified by:
        findMembers in class Discovery
        Parameters:
        members - A list of logical addresses (typically UUIDs). If null, then information for all members is fetched
        initial_discovery - Set to true if this is for the initial membership discovery. Some protocols (e.g. file based ones) may return only the information for the coordinator(s).
        responses - The list to which responses should be added
      • sendDiscoveryRequest

        protected void sendDiscoveryRequest​(java.lang.String cluster_name,
                                            java.util.List<Address> members_to_find,
                                            boolean initial_discovery)
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • sendMcastDiscoveryRequest

        protected void sendMcastDiscoveryRequest​(Message msg)