Package org.apache.sysds.runtime.controlprogram.federated

## Class FederatedLookupTable

- java.lang.Object
- - org.apache.sysds.runtime.controlprogram.federated.FederatedLookupTable

-     public class FederatedLookupTable
      extends Object

  Lookup table mapping from a FedUniqueCoordID (funCID) to an ExecutionContextMap (ECM) so that every coordinator can address federated variables with its own local sequential variable IDs. Therefore, the IDs among different coordinators do not have to be distinct, as every coordinator works with a separate ECM at the FederatedWorker.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static String` | `NOHOST` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `FederatedLookupTable()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `clear()` |
    `boolean` | `containsFunCID​(String host, long pid)` | Check if there is a mapped ExecutionContextMap for the coordinator with the given host and pid.
    `ExecutionContextMap` | `getECM​(String host, long pid)` | Get the ExecutionContextMap corresponding to the given host and pid of the requesting coordinator from the lookup table.
    `String` | `toString()` |

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### NOHOST

          public static final String NOHOST

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### FederatedLookupTable

          public FederatedLookupTable()

  - ### Method Detail

    - #### clear

          public void clear()

    - #### getECM

          public ExecutionContextMap getECM​(String host,
                                            long pid)

      Get the ExecutionContextMap corresponding to the given host and pid of the requesting coordinator from the lookup table. Create a new ExecutionContextMap if there is no corresponding entry in the lookup table.
      Parameters:
        `host` - the host string of the requesting coordinator (usually IP address)
        `pid` - the process id of the requesting coordinator
      Returns:
        ExecutionContextMap the ECM corresponding to the requesting coordinator

    - #### containsFunCID

          public boolean containsFunCID​(String host,
                                        long pid)

      Check if there is a mapped ExecutionContextMap for the coordinator with the given host and pid.
      Parameters:
        `host` - the host string of the requesting coordinator (usually IP address)
        `pid` - the process id of the requesting coordinator
      Returns:
        boolean true if there is a lookup table entry, otherwise false

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`