Package org.apache.sysds.hops.cost
Class HopRel
- java.lang.Object
- 
- org.apache.sysds.hops.cost.HopRel
 
- 
 public class HopRel extends Object HopRel provides a representation of the relation between a hop, the cost of setting a given FederatedOutput value, and the input dependency with the given FederatedOutput value. The HopRel class is used when building and selecting an optimal federated execution plan in IPAPassRewriteFederatedPlan. The input dependency is needed to hold the valid and optimal FederatedOutput values for the inputs.
- 
- 
Constructor SummaryConstructors Constructor Description HopRel(Hop associatedHop, FEDInstruction.FederatedOutput fedOut, FTypes.FType fType, MemoTable hopRelMemo, ArrayList<Hop> inputs)Constructs a HopRel with input dependency and cost estimate based on entries in hopRelMemo.HopRel(Hop associatedHop, FEDInstruction.FederatedOutput fedOut, FTypes.FType fType, MemoTable hopRelMemo, List<Hop> inputs, List<FTypes.FType> inputDependency)HopRel(Hop associatedHop, FEDInstruction.FederatedOutput fedOut, MemoTable hopRelMemo)Constructs a HopRel with input dependency and cost estimate based on entries in hopRelMemo.HopRel(Hop associatedHop, FEDInstruction.FederatedOutput fedOut, MemoTable hopRelMemo, ArrayList<Hop> inputs)Constructs a HopRel with input dependency and cost estimate based on entries in hopRelMemo.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCostPointer(long hopID)Adds hopID to set of hops pointing to this HopRel.booleanexistingCostPointer(long currentHopID)Checks if another Hop is refering to this HopRel in memo table.doublegetCost()Get total cost as doubleFederatedCostgetCostObject()Get cost objectTypes.ExecTypegetExecType()FEDInstruction.FederatedOutputgetFederatedOutput()FTypes.FTypegetFType()HopgetHopRef()List<HopRel>getInputDependency()booleanhasFederatedOutput()booleanhasLocalOutput()voidsetFType(FTypes.FType fType)StringtoString()
 
- 
- 
- 
Constructor Detail- 
HopRelpublic HopRel(Hop associatedHop, FEDInstruction.FederatedOutput fedOut, MemoTable hopRelMemo) Constructs a HopRel with input dependency and cost estimate based on entries in hopRelMemo.- Parameters:
- associatedHop- hop associated with this HopRel
- fedOut- FederatedOutput value assigned to this HopRel
- hopRelMemo- memo table storing other HopRels including the inputs of associatedHop
 
 - 
HopRelpublic HopRel(Hop associatedHop, FEDInstruction.FederatedOutput fedOut, MemoTable hopRelMemo, ArrayList<Hop> inputs) Constructs a HopRel with input dependency and cost estimate based on entries in hopRelMemo.- Parameters:
- associatedHop- hop associated with this HopRel
- fedOut- FederatedOutput value assigned to this HopRel
- hopRelMemo- memo table storing other HopRels including the inputs of associatedHop
- inputs- hop inputs which input dependencies and cost is based on
 
 - 
HopRelpublic HopRel(Hop associatedHop, FEDInstruction.FederatedOutput fedOut, FTypes.FType fType, MemoTable hopRelMemo, ArrayList<Hop> inputs) Constructs a HopRel with input dependency and cost estimate based on entries in hopRelMemo.- Parameters:
- associatedHop- hop associated with this HopRel
- fedOut- FederatedOutput value assigned to this HopRel
- fType- Federated Type of the output of this hopRel
- hopRelMemo- memo table storing other HopRels including the inputs of associatedHop
- inputs- hop inputs which input dependencies and cost is based on
 
 - 
HopRelpublic HopRel(Hop associatedHop, FEDInstruction.FederatedOutput fedOut, FTypes.FType fType, MemoTable hopRelMemo, List<Hop> inputs, List<FTypes.FType> inputDependency) 
 
- 
 - 
Method Detail- 
addCostPointerpublic void addCostPointer(long hopID) Adds hopID to set of hops pointing to this HopRel. By storing the hopID it can later be determined if the cost stored in this HopRel is already used as input cost in another HopRel.- Parameters:
- hopID- added to set of stored cost pointers
 
 - 
existingCostPointerpublic boolean existingCostPointer(long currentHopID) Checks if another Hop is refering to this HopRel in memo table. A reference from a HopRel with same Hop ID is allowed, so this ID is ignored when checking references.- Parameters:
- currentHopID- to ignore when checking references
- Returns:
- true if another Hop refers to this HopRel in memo table
 
 - 
hasLocalOutputpublic boolean hasLocalOutput() 
 - 
hasFederatedOutputpublic boolean hasFederatedOutput() 
 - 
getFederatedOutputpublic FEDInstruction.FederatedOutput getFederatedOutput() 
 - 
getHopRefpublic Hop getHopRef() 
 - 
getFTypepublic FTypes.FType getFType() 
 - 
setFTypepublic void setFType(FTypes.FType fType) 
 - 
getExecTypepublic Types.ExecType getExecType() 
 - 
getCostpublic double getCost() Get total cost as double- Returns:
- cost as double
 
 - 
getCostObjectpublic FederatedCost getCostObject() Get cost object- Returns:
- cost object
 
 
- 
 
-