Class FederationMap
- java.lang.Object
- 
- org.apache.sysds.runtime.controlprogram.federated.FederationMap
 
- 
 public class FederationMap extends Object 
- 
- 
Constructor SummaryConstructors Constructor Description 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, FTypes.FType type)FederationMap(List<org.apache.commons.lang3.tuple.Pair<FederatedRange,FederatedData>> fedMap)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description FederationMapbind(long rOffset, long cOffset, FederationMap that)FederatedRequestbroadcast(CacheableData<?> data)FederatedRequestbroadcast(MatrixLineagePair moLin)FederatedRequestbroadcast(ScalarObject scalar)FederatedRequest[]broadcastSliced(CacheableData<?> data, boolean transposed)FederatedRequest[]broadcastSliced(CacheableData<?> data, boolean isFrame, int[][] ix)FederatedRequest[]broadcastSliced(CacheableData<?> data, LineageItem lineageItem, boolean isFrame, int[][] ix)FederatedRequest[]broadcastSliced(MatrixLineagePair moLin, boolean transposed)FederatedRequest[]broadcastSliced(MatrixLineagePair moLin, boolean isFrame, int[][] ix)FederatedRequestcleanup(long tid, long... id)FederationMapclone()FederationMapcopyWithNewID()Copy the federation map with the next available federated ID as reference to the federated data.FederationMapcopyWithNewID(long id)Copy the federation map with the given ID as reference to the federated data.FederationMapcopyWithNewID(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.FederationMapcopyWithNewIDAndRange(int[][] ix, long outputID, FTypes.FType type)FederationMapcopyWithNewIDAndRange(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.FederationMapcopyWithNewIDAndRange(long rowRangeEnd, long colRangeEnd, long outputID, FTypes.FType type)voidexecCleanup(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, FederatedRange[] fedRange1, FederatedRequest elseFr, FederatedRequest frSlice1, FederatedRequest frSlice2, 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)FederationMapfilter(IndexRange ixrange)voidforEachParallel(BiFunction<FederatedRange,FederatedData,Void> forEachFunction)Execute a function for eachFederatedRange+FederatedDatapair.FederatedData[]getFederatedData()FederatedRange[]getFederatedRanges()longgetID()List<org.apache.commons.lang3.tuple.Pair<FederatedRange,FederatedData>>getMap()longgetMaxIndexInRange(int dim)intgetSize()FTypes.FTypegetType()FederationMapidentCopy(long tid, long id)booleanisAligned(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)booleanisAligned(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)booleanisAligned(FederationMap that, FTypes.AlignType... alignTypes)helper function for checking multiple allowed alignment typesbooleanisInitialized()FederationMapmapParallel(long newVarID, BiFunction<FederatedRange,FederatedData,Void> mappingFunction)Execute a function for eachFederatedRange+FederatedDatapair mapping the pairs to their new form by directly changing bothFederatedRangeandFederatedData.FederationMapmodifyFedRanges(long value, int dim)Take the federated mapping and sets one dimension of all federated ranges to the specified value.List<org.apache.commons.lang3.tuple.Pair<FederatedRange,Future<FederatedResponse>>>requestFederatedData()voidreverseFedMap()voidsetType(FTypes.FType type)StringtoString()FederationMaptranspose()
 
- 
- 
- 
Constructor Detail- 
FederationMappublic FederationMap(List<org.apache.commons.lang3.tuple.Pair<FederatedRange,FederatedData>> fedMap) 
 - 
FederationMappublic FederationMap(long ID, List<org.apache.commons.lang3.tuple.Pair<FederatedRange,FederatedData>> fedMap)
 - 
FederationMappublic FederationMap(long ID, List<org.apache.commons.lang3.tuple.Pair<FederatedRange,FederatedData>> fedMap, FTypes.FType type)
 
- 
 - 
Method Detail- 
getIDpublic long getID() 
 - 
getTypepublic FTypes.FType getType() 
 - 
isInitializedpublic boolean isInitialized() 
 - 
setTypepublic void setType(FTypes.FType type) 
 - 
getSizepublic int getSize() 
 - 
getFederatedRangespublic FederatedRange[] getFederatedRanges() 
 - 
getFederatedDatapublic FederatedData[] getFederatedData() 
 - 
getMappublic List<org.apache.commons.lang3.tuple.Pair<FederatedRange,FederatedData>> getMap() 
 - 
broadcastpublic FederatedRequest broadcast(CacheableData<?> data) 
 - 
broadcastpublic FederatedRequest broadcast(MatrixLineagePair moLin) 
 - 
broadcastpublic FederatedRequest broadcast(ScalarObject scalar) 
 - 
broadcastSlicedpublic FederatedRequest[] broadcastSliced(CacheableData<?> data, boolean transposed) 
 - 
broadcastSlicedpublic FederatedRequest[] broadcastSliced(MatrixLineagePair moLin, boolean transposed) 
 - 
broadcastSlicedpublic FederatedRequest[] broadcastSliced(CacheableData<?> data, boolean isFrame, int[][] ix) 
 - 
broadcastSlicedpublic FederatedRequest[] broadcastSliced(MatrixLineagePair moLin, boolean isFrame, int[][] ix) 
 - 
broadcastSlicedpublic FederatedRequest[] broadcastSliced(CacheableData<?> data, LineageItem lineageItem, boolean isFrame, int[][] ix) 
 - 
isAlignedpublic boolean isAligned(FederationMap that, FTypes.AlignType... alignTypes) helper function for checking multiple allowed alignment types- Parameters:
- that- FederationMap to check alignment with
- alignTypes- collection of alignment types which should be checked
- Returns:
- true if this and that FederationMap are aligned according to at least one alignment type
 
 - 
isAlignedpublic 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)- Parameters:
- that- FederationMap to check alignment with
- transposed- true if that FederationMap should be transposed before checking alignment
- Returns:
- true if this and that FederationMap are aligned
 
 - 
isAlignedpublic 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)- Parameters:
- that- FederationMap to check alignment with
- transposed- true if that FederationMap should be transposed before checking alignment
- equalRows- true to indicate that the row dimension should be checked for alignment
- equalCols- true to indicate that the col dimension should be checked for alignment
- Returns:
- true if this and that FederationMap are aligned
 
 - 
executepublic Future<FederatedResponse>[] execute(long tid, FederatedRequest... fr) 
 - 
executepublic Future<FederatedResponse>[] execute(long tid, boolean wait, FederatedRequest... fr) 
 - 
executepublic Future<FederatedResponse>[] execute(long tid, FederatedRequest[] frSlices, FederatedRequest... fr) 
 - 
executepublic Future<FederatedResponse>[] execute(long tid, boolean wait, FederatedRequest[] frSlices, FederatedRequest... fr) 
 - 
executepublic Future<FederatedResponse>[] execute(long tid, boolean wait, FederatedRange[] fedRange1, FederatedRequest elseFr, FederatedRequest frSlice1, FederatedRequest frSlice2, FederatedRequest fr) 
 - 
executepublic Future<FederatedResponse>[] execute(long tid, boolean wait, FederatedRange[] fedRange1, FederatedRequest elseFr, FederatedRequest[] frSlices1, FederatedRequest[] frSlices2, FederatedRequest... fr) 
 - 
executepublic Future<FederatedResponse>[] execute(long tid, boolean wait, FederatedRequest[] frSlices1, FederatedRequest[] frSlices2, FederatedRequest... fr) 
 - 
executeMultipleSlicespublic Future<FederatedResponse>[] executeMultipleSlices(long tid, boolean wait, FederatedRequest[][] frSlices, FederatedRequest[] fr) 
 - 
requestFederatedDatapublic List<org.apache.commons.lang3.tuple.Pair<FederatedRange,Future<FederatedResponse>>> requestFederatedData() 
 - 
cleanuppublic FederatedRequest cleanup(long tid, long... id) 
 - 
execCleanuppublic void execCleanup(long tid, long... id)
 - 
identCopypublic FederationMap identCopy(long tid, long id) 
 - 
copyWithNewIDpublic FederationMap copyWithNewID() Copy the federation map with the next available federated ID as reference to the federated data. This means that the federated map refers to the next federated data object on the workers.- Returns:
- copied federation map with next federated ID
 
 - 
copyWithNewIDpublic FederationMap copyWithNewID(long id) Copy the federation map with the given ID as reference to the federated data. This means that the federated map refers to the federated data object on the workers with the given ID.- Parameters:
- id- federated data object ID
- Returns:
- copied federation map with given federated ID
 
 - 
copyWithNewIDpublic 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. This means that the federated map refers to the federated data object on the workers with the given ID.- Parameters:
- id- federated data object ID
- clen- column length of data objects on federated workers
- Returns:
- copied federation map with given federated ID and ranges adapted according to clen
 
 - 
copyWithNewIDAndRangepublic 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. The overlapping ranges are given an overlap number to separate the ranges when putting to the federated map. The federation map returned is of type FType.PART.- Parameters:
- rowRangeEnd- end of range for the rows
- colRangeEnd- end of range for the columns
- outputID- ID given to the output
- Returns:
- new federation map with overlapping ranges with partially aggregated values
 
 - 
copyWithNewIDAndRangepublic FederationMap copyWithNewIDAndRange(long rowRangeEnd, long colRangeEnd, long outputID, FTypes.FType type) 
 - 
copyWithNewIDAndRangepublic FederationMap copyWithNewIDAndRange(int[][] ix, long outputID, FTypes.FType type) 
 - 
bindpublic FederationMap bind(long rOffset, long cOffset, FederationMap that) 
 - 
modifyFedRangespublic FederationMap modifyFedRanges(long value, int dim) Take the federated mapping and sets one dimension of all federated ranges to the specified value.- Parameters:
- value- long value for setting the dimension
- dim- indicates if the row (0) or column (1) dimension should be set to value
- Returns:
- FederationMap with the modified federated ranges
 
 - 
transposepublic FederationMap transpose() 
 - 
getMaxIndexInRangepublic long getMaxIndexInRange(int dim) 
 - 
forEachParallelpublic void forEachParallel(BiFunction<FederatedRange,FederatedData,Void> forEachFunction) Execute a function for eachFederatedRange+FederatedDatapair. The function should not change any data of the pair and instead usemapParallelif 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
 
 - 
mapParallelpublic FederationMap mapParallel(long newVarID, BiFunction<FederatedRange,FederatedData,Void> mappingFunction) Execute a function for eachFederatedRange+FederatedDatapair mapping the pairs to their new form by directly changing bothFederatedRangeandFederatedData. The varIDs don't have to be changed by themappingFunctionas 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
 
 - 
filterpublic FederationMap filter(IndexRange ixrange) 
 - 
reverseFedMappublic void reverseFedMap() 
 - 
clonepublic FederationMap clone() 
 
- 
 
-