Class LOCAL_PING

  • All Implemented Interfaces:
    Lifecycle

    public class LOCAL_PING
    extends Discovery
    Discovery protocol for finding members in the local process only. Doesn't send discovery requests and responses, but fetches discovery information directly from a hashmap. Used mainly by unit test.
    Since:
    4.1.3
    Author:
    Bela Ban
    • Field Detail

      • discovery

        protected static final java.util.Map<java.lang.String,​java.util.List<PingData>> discovery
        Map of cluster names and address-protocol mappings. Used for routing messages to all or single members
      • FUNC

        protected static final java.util.function.Function<java.lang.String,​java.util.List<PingData>> FUNC
    • Constructor Detail

      • LOCAL_PING

        public LOCAL_PING()
    • Method Detail

      • clear

        public static void clear()
      • print

        public static java.lang.String print()
      • getDiscoveryCacheSize

        public static int getDiscoveryCacheSize()
      • findMembers

        public Responses findMembers​(java.util.List<Address> members,
                                     boolean initial_discovery,
                                     boolean async,
                                     long timeout)
        Overrides:
        findMembers in class Discovery
      • 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
      • down

        public java.lang.Object down​(Event evt)
        Description copied from class: Protocol
        An event is to be sent down the stack. A protocol may want to examine its type and perform some action on it, depending on the event's type. If the event is a message MSG, then the protocol may need to add a header to it (or do nothing at all) before sending it down the stack using down_prot.down().
        Overrides:
        down in class Discovery
      • addAddressToLocalCache

        protected void addAddressToLocalCache​(Address addr,
                                              PhysicalAddress phys_addr)