public class FederationMap extends Object
Modifier and Type | Class and Description |
---|---|
static class |
FederationMap.FPartitioning |
static class |
FederationMap.FReplication |
static class |
FederationMap.FType |
Constructor and Description |
---|
FederationMap(List<org.apache.commons.lang3.tuple.Pair<FederatedRange,FederatedData>> fedMap) |
FederationMap(long ID,
List<org.apache.commons.lang3.tuple.Pair<FederatedRange,FederatedData>> fedMap) |
FederationMap(long ID,
List<org.apache.commons.lang3.tuple.Pair<FederatedRange,FederatedData>> fedMap,
FederationMap.FType type) |
Modifier and Type | Method and Description |
---|---|
FederationMap |
bind(long rOffset,
long cOffset,
FederationMap that) |
FederatedRequest |
broadcast(CacheableData<?> data) |
FederatedRequest |
broadcast(ScalarObject scalar) |
FederatedRequest[] |
broadcastSliced(CacheableData<?> data,
boolean transposed)
Creates separate slices of an input data object according to the index ranges of federated data.
|
FederatedRequest[] |
broadcastSliced(CacheableData<?> data,
boolean isFrame,
int[][] ix) |
FederatedRequest |
cleanup(long tid,
long... id) |
FederationMap |
clone() |
FederationMap |
copyWithNewID()
Copy the federation map with the next available federated ID as reference to the federated data.
|
FederationMap |
copyWithNewID(long id)
Copy the federation map with the given ID as reference to the federated data.
|
FederationMap |
copyWithNewID(long id,
long clen)
Copy the federation map with the given ID as reference to the federated data
and with given clen as end dimension for the columns in the range.
|
FederationMap |
copyWithNewIDAndRange(long rowRangeEnd,
long colRangeEnd,
long outputID)
Copy federated mapping while giving the federated data new IDs
and setting the ranges from zero to row and column ends specified.
|
void |
execCleanup(long tid,
long... id) |
Future<FederatedResponse>[] |
execute(long tid,
boolean wait,
FederatedRange[] fedRange1,
FederatedRequest elseFr,
FederatedRequest[] frSlices1,
FederatedRequest[] frSlices2,
FederatedRequest... fr) |
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,
boolean wait,
FederatedRequest[] frSlices1,
FederatedRequest[] frSlices2,
FederatedRequest... fr) |
Future<FederatedResponse>[] |
execute(long tid,
FederatedRequest... fr) |
Future<FederatedResponse>[] |
execute(long tid,
FederatedRequest[] frSlices,
FederatedRequest... fr) |
Future<FederatedResponse>[] |
executeMultipleSlices(long tid,
boolean wait,
FederatedRequest[][] frSlices,
FederatedRequest[] fr) |
FederationMap |
filter(IndexRange ixrange) |
void |
forEachParallel(BiFunction<FederatedRange,FederatedData,Void> forEachFunction)
Execute a function for each
FederatedRange + FederatedData pair. |
FederatedData[] |
getFederatedData() |
FederatedRange[] |
getFederatedRanges() |
long |
getID() |
List<org.apache.commons.lang3.tuple.Pair<FederatedRange,FederatedData>> |
getMap() |
long |
getMaxIndexInRange(int dim) |
int |
getSize() |
FederationMap.FType |
getType() |
FederationMap |
identCopy(long tid,
long id) |
boolean |
isAligned(FederationMap that,
boolean transposed)
Determines if the two federation maps are aligned row/column partitions
at the same federated sites (which allows for purely federated operation)
|
boolean |
isAligned(FederationMap that,
boolean transposed,
boolean equalRows,
boolean equalCols)
determines if the two federated data are aligned row/column partitions (depending on parameters equalRows/equalCols)
at the same federated site (which often allows for purely federated operations)
|
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 . |
List<org.apache.commons.lang3.tuple.Pair<FederatedRange,Future<FederatedResponse>>> |
requestFederatedData() |
void |
reverseFedMap() |
void |
setType(FederationMap.FType type) |
String |
toString() |
FederationMap |
transpose() |
public FederationMap(List<org.apache.commons.lang3.tuple.Pair<FederatedRange,FederatedData>> fedMap)
public FederationMap(long ID, List<org.apache.commons.lang3.tuple.Pair<FederatedRange,FederatedData>> fedMap)
public FederationMap(long ID, List<org.apache.commons.lang3.tuple.Pair<FederatedRange,FederatedData>> fedMap, FederationMap.FType type)
public long getID()
public FederationMap.FType getType()
public boolean isInitialized()
public void setType(FederationMap.FType type)
public int getSize()
public FederatedRange[] getFederatedRanges()
public FederatedData[] getFederatedData()
public List<org.apache.commons.lang3.tuple.Pair<FederatedRange,FederatedData>> getMap()
public FederatedRequest broadcast(CacheableData<?> data)
public FederatedRequest broadcast(ScalarObject scalar)
public FederatedRequest[] broadcastSliced(CacheableData<?> data, boolean transposed)
data
- input data object (matrix, tensor, frame)transposed
- false: slice according to federated data, true: slice according to transposed federated datapublic FederatedRequest[] broadcastSliced(CacheableData<?> data, boolean isFrame, int[][] ix)
public boolean isAligned(FederationMap that, boolean transposed)
that
- FederationMap to check alignment withtransposed
- true if that FederationMap should be transposed before checking alignmentpublic boolean isAligned(FederationMap that, boolean transposed, boolean equalRows, boolean equalCols)
that
- FederationMap to check alignment withtransposed
- true if that FederationMap should be transposed before checking alignmentequalRows
- true to indicate that the row dimension should be checked for alignmentequalCols
- true to indicate that the col dimension should be checked for alignmentpublic Future<FederatedResponse>[] execute(long tid, FederatedRequest... fr)
public Future<FederatedResponse>[] execute(long tid, boolean wait, FederatedRequest... fr)
public Future<FederatedResponse>[] execute(long tid, FederatedRequest[] frSlices, FederatedRequest... fr)
public Future<FederatedResponse>[] execute(long tid, boolean wait, FederatedRequest[] frSlices, FederatedRequest... fr)
public Future<FederatedResponse>[] execute(long tid, boolean wait, FederatedRange[] fedRange1, FederatedRequest elseFr, FederatedRequest[] frSlices1, FederatedRequest[] frSlices2, FederatedRequest... fr)
public Future<FederatedResponse>[] execute(long tid, boolean wait, FederatedRequest[] frSlices1, FederatedRequest[] frSlices2, FederatedRequest... fr)
public Future<FederatedResponse>[] executeMultipleSlices(long tid, boolean wait, FederatedRequest[][] frSlices, FederatedRequest[] fr)
public List<org.apache.commons.lang3.tuple.Pair<FederatedRange,Future<FederatedResponse>>> requestFederatedData()
public FederatedRequest cleanup(long tid, long... id)
public void execCleanup(long tid, long... id)
public FederationMap identCopy(long tid, long id)
public FederationMap copyWithNewID()
public FederationMap copyWithNewID(long id)
id
- federated data object IDpublic FederationMap copyWithNewID(long id, long clen)
id
- federated data object IDclen
- column length of data objects on federated workerspublic FederationMap copyWithNewIDAndRange(long rowRangeEnd, long colRangeEnd, long outputID)
rowRangeEnd
- end of range for the rowscolRangeEnd
- end of range for the columnsoutputID
- ID given to the outputpublic FederationMap bind(long rOffset, long cOffset, FederationMap that)
public FederationMap transpose()
public long getMaxIndexInRange(int dim)
public void forEachParallel(BiFunction<FederatedRange,FederatedData,Void> forEachFunction)
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.forEachFunction
- function to execute for each pairpublic FederationMap mapParallel(long newVarID, BiFunction<FederatedRange,FederatedData,Void> mappingFunction)
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.newVarID
- the new varID to be used by the new FederationMapmappingFunction
- the function directly changing ranges and dataFederationMap
public FederationMap filter(IndexRange ixrange)
public void reverseFedMap()
public FederationMap clone()
Copyright © 2021 The Apache Software Foundation. All rights reserved.