org.apache.sysds.runtime.controlprogram.federated

## Class FederationMap

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

-     public class FederationMap
      extends Object

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `FederationMap.FType`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FederationMap(long ID, Map<FederatedRange,FederatedData> fedMap)`
    `FederationMap(long ID, Map<FederatedRange,FederatedData> fedMap, FederationMap.FType type)`
    `FederationMap(Map<FederatedRange,FederatedData> fedMap)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `FederatedRequest` | `broadcast(CacheableData<?> data)`
    `FederatedRequest` | `broadcast(ScalarObject scalar)`
    `FederatedRequest[]` | `broadcastSliced(CacheableData<?> data, boolean transposed)`
    `FederatedRequest` | `cleanup(long tid, long... id)`
    `FederationMap` | `copyWithNewID()`
    `FederationMap` | `copyWithNewID(long id)`
    `FederationMap` | `copyWithNewID(long id, long clen)`
    `void` | `execCleanup(long tid, long... id)`
    `Future<FederatedResponse>[]` | `execute(long tid, boolean wait, FederatedRequest... fr)`
    `Future<FederatedResponse>[]` | `execute(long tid, boolean wait, FederatedRequest[] frSlices, FederatedRequest... fr)`
    `Future<FederatedResponse>[]` | `execute(long tid, FederatedRequest... fr)`
    `Future<FederatedResponse>[]` | `execute(long tid, FederatedRequest[] frSlices, FederatedRequest... fr)`
    `void` | `forEachParallel(BiFunction<FederatedRange,FederatedData,Void> forEachFunction)` Execute a function for each `FederatedRange` + `FederatedData` pair.
    `FederatedRange[]` | `getFederatedRanges()`
    `long` | `getID()`
    `long` | `getMaxIndexInRange(int dim)`
    `FederationMap.FType` | `getType()`
    `boolean` | `isAligned(FederationMap that, boolean transposed)`
    `boolean` | `isInitialized()`
    `FederationMap` | `mapParallel(long newVarID, BiFunction<FederatedRange,FederatedData,Void> mappingFunction)` Execute a function for each `FederatedRange` + `FederatedData` pair mapping the pairs to their new form by directly changing both `FederatedRange` and `FederatedData`.
    `FederationMap` | `rbind(long offset, FederationMap that)`
    `List<org.apache.commons.lang3.tuple.Pair<FederatedRange,Future<FederatedResponse>>>` | `requestFederatedData()`
    `void` | `setType(FederationMap.FType type)`
    `FederationMap` | `transpose()`

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

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

- - ### Constructor Detail

    - #### FederationMap

          public FederationMap(Map<FederatedRange,FederatedData> fedMap)

    - #### FederationMap

          public FederationMap(long ID,
                               Map<FederatedRange,FederatedData> fedMap)

    - #### FederationMap

          public FederationMap(long ID,
                               Map<FederatedRange,FederatedData> fedMap,
                               FederationMap.FType type)

  - ### Method Detail

    - #### getID

          public long getID()

    - #### getType

          public FederationMap.FType getType()

    - #### isInitialized

          public boolean isInitialized()

    - #### setType

          public void setType(FederationMap.FType type)

    - #### getFederatedRanges

          public FederatedRange[] getFederatedRanges()

    - #### broadcast

          public FederatedRequest broadcast(CacheableData<?> data)

    - #### broadcast

          public FederatedRequest broadcast(ScalarObject scalar)

    - #### broadcastSliced

          public FederatedRequest[] broadcastSliced(CacheableData<?> data,
                                                    boolean transposed)

    - #### isAligned

          public boolean isAligned(FederationMap that,
                                   boolean transposed)

    - #### execute

          public Future<FederatedResponse>[] execute(long tid,
                                                     FederatedRequest... fr)

    - #### execute

          public Future<FederatedResponse>[] execute(long tid,
                                                     boolean wait,
                                                     FederatedRequest... fr)

    - #### execute

          public Future<FederatedResponse>[] execute(long tid,
                                                     FederatedRequest[] frSlices,
                                                     FederatedRequest... fr)

    - #### execute

          public Future<FederatedResponse>[] execute(long tid,
                                                     boolean wait,
                                                     FederatedRequest[] frSlices,
                                                     FederatedRequest... fr)

    - #### requestFederatedData

          public List<org.apache.commons.lang3.tuple.Pair<FederatedRange,Future<FederatedResponse>>> requestFederatedData()

    - #### cleanup

          public FederatedRequest cleanup(long tid,
                                          long... id)

    - #### execCleanup

          public void execCleanup(long tid,
                                  long... id)

    - #### copyWithNewID

          public FederationMap copyWithNewID()

    - #### copyWithNewID

          public FederationMap copyWithNewID(long id)

    - #### copyWithNewID

          public FederationMap copyWithNewID(long id,
                                             long clen)

    - #### rbind

          public FederationMap rbind(long offset,
                                     FederationMap that)

    - #### transpose

          public FederationMap transpose()

    - #### getMaxIndexInRange

          public long getMaxIndexInRange(int dim)

    - #### forEachParallel

          public void forEachParallel(BiFunction<FederatedRange,FederatedData,Void> forEachFunction)

      Execute a function for each `FederatedRange` + `FederatedData` pair. The function should not change any data of the pair and instead use `mapParallel` if that is a necessity. Note that this operation is parallel and necessary synchronisation has to be performed.
      Parameters:
        `forEachFunction` - function to execute for each pair

    - #### mapParallel

          public FederationMap mapParallel(long newVarID,
                                           BiFunction<FederatedRange,FederatedData,Void> mappingFunction)

      Execute a function for each `FederatedRange` + `FederatedData` pair mapping the pairs to their new form by directly changing both `FederatedRange` and `FederatedData`. The varIDs don't have to be changed by the `mappingFunction` as that will be done by this method. Note that this operation is parallel and necessary synchronisation has to be performed.
      Parameters:
        `newVarID` - the new varID to be used by the new FederationMap
        `mappingFunction` - the function directly changing ranges and data
      Returns:
        the new `FederationMap`

Copyright © 2020 The Apache Software Foundation. All rights reserved.