Class 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 Detail

      • HopRel

        public 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
      • HopRel

        public 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
      • HopRel

        public 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
    • Method Detail

      • addCostPointer

        public 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
      • existingCostPointer

        public 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
      • hasLocalOutput

        public boolean hasLocalOutput()
      • hasFederatedOutput

        public boolean hasFederatedOutput()
      • getInputDependency

        public List<HopRel> getInputDependency()
      • getHopRef

        public Hop getHopRef()
      • getCost

        public double getCost()
        Get total cost as double
        Returns:
        cost as double
      • getCostObject

        public FederatedCost getCostObject()
        Get cost object
        Returns:
        cost object