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
  • Field Details

    • discovery

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

      protected static final Function<String,List<PingData>> FUNC
  • Constructor Details

    • LOCAL_PING

      public LOCAL_PING()
  • Method Details

    • isDynamic

      public boolean isDynamic()
      Specified by:
      isDynamic in class Discovery
    • stop

      public void stop()
      Description copied from class: Protocol
      Called on a JChannel.disconnect(); stops work (e.g. by closing multicast socket). Will be called from top to bottom.
      Specified by:
      stop in interface Lifecycle
      Overrides:
      stop in class Discovery
    • clear

      public static void clear()
    • print

      public static String print()
    • getDiscoveryCacheSize

      public static int getDiscoveryCacheSize()
    • findMembers

      public Responses findMembers(List<Address> members, boolean initial_discovery, boolean async, long timeout)
      Overrides:
      findMembers in class Discovery
    • findMembers

      public void findMembers(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 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
    • handleConnect

      public void handleConnect()
      Overrides:
      handleConnect in class Discovery
    • handleDisconnect

      public void handleDisconnect()
      Overrides:
      handleDisconnect in class Discovery
    • addAddressToLocalCache

      protected void addAddressToLocalCache(Address addr, PhysicalAddress phys_addr)