Class PhysicalPlanFactory

java.lang.Object
se.liu.ida.hefquin.engine.queryplan.utils.PhysicalPlanFactory

public class PhysicalPlanFactory extends Object
  • Constructor Details

    • PhysicalPlanFactory

      public PhysicalPlanFactory()
  • Method Details

    • createPlan

      public static PhysicalPlan createPlan(LogicalOperator lop, LogicalToPhysicalOpConverter lop2pop, PhysicalPlan... subplans)
      Creates a physical plan in which the root operator is the physical operator that the given LogicalToPhysicalOpConverter returns for the given logical operator. The given subplans become children of the root operator.
    • createPlan

      public static PhysicalPlan createPlan(LogicalOperator lop, QueryPlanningInfo qpInfo, LogicalToPhysicalOpConverter lop2pop, PhysicalPlan... subplans)
      Creates a physical plan in which the root operator is the physical operator that the given LogicalToPhysicalOpConverter returns for the given logical operator. The given subplans become children of the root operator.

      The qpInfo argument may be null. Provide an actual QueryPlanningInfo object only if this object already exists and the plan is indeed meant to be associated with it (for instance, when creating a physical plan for a logical plan that is associated with this object). Also, do not create different physical plans with the same QueryPlanningInfo object because these objects may later be extended with additional properties for each plan; instead, make copies of such an object if needed.

    • createPlan

      public static PhysicalPlan createPlan(PhysicalOperator pop, PhysicalPlan... subplans)
      Creates a physical plan in which the root operator is the default physical operator for the given logical operator, as per LogicalToPhysicalOpConverter. The given subplans become children of the root operator.
    • createPlan

      public static PhysicalPlan createPlan(PhysicalOperator pop, QueryPlanningInfo qpInfo, PhysicalPlan... subplans)
      Creates a physical plan in which the root operator is the default physical operator for the given logical operator, as per LogicalToPhysicalOpConverter. The given subplans become children of the root operator.

      The qpInfo argument may be null. Provide an actual QueryPlanningInfo object only if this object already exists and the plan is indeed meant to be associated with it (for instance, when creating a physical plan for a logical plan that is associated with this object). Also, do not create different physical plans with the same QueryPlanningInfo object because these objects may later be extended with additional properties for each plan; instead, make copies of such an object if needed.

    • createPlanWithRequest

      public static PhysicalPlan createPlanWithRequest(DataRetrievalRequest req, FederationMember fm)
      Creates a plan with a request operator as root operator.
    • createPlan

      public static PhysicalPlan createPlan(NullaryLogicalOp rootOp, QueryPlanningInfo qpInfo, LogicalToPhysicalOpConverter lop2pop)
      Creates a physical plan in which the root operator is the physical operator that the given LogicalToPhysicalOpConverter returns for the given logical operator.

      The qpInfo argument may be null. Provide an actual QueryPlanningInfo object only if this object already exists and the plan is indeed meant to be associated with it (for instance, when creating a physical plan for a logical plan that is associated with this object). Also, do not create different physical plans with the same QueryPlanningInfo object because these objects may later be extended with additional properties for each plan; instead, make copies of such an object if needed.

    • createPlan

      public static PhysicalPlan createPlan(NullaryPhysicalOp rootOp, QueryPlanningInfo qpInfo)
      Creates a physical plan with the given root operator.

      The qpInfo argument may be null. Provide an actual QueryPlanningInfo object only if this object already exists and the plan is indeed meant to be associated with it (for instance, when creating a physical plan for a logical plan that is associated with this object). Also, do not create different physical plans with the same QueryPlanningInfo object because these objects may later be extended with additional properties for each plan; instead, make copies of such an object if needed.

    • createPlan

      public static PhysicalPlan createPlan(UnaryLogicalOp rootOp, QueryPlanningInfo qpInfo, LogicalToPhysicalOpConverter lop2pop, PhysicalPlan subplan)
      Creates a physical plan in which the root operator is the physical operator that the given LogicalToPhysicalOpConverter returns for the given logical operator. The given subplan becomes the child of the root operator.

      The qpInfo argument may be null. Provide an actual QueryPlanningInfo object only if this object already exists and the plan is indeed meant to be associated with it (for instance, when creating a physical plan for a logical plan that is associated with this object). Also, do not create different physical plans with the same QueryPlanningInfo object because these objects may later be extended with additional properties for each plan; instead, make copies of such an object if needed.

    • createPlan

      public static PhysicalPlan createPlan(UnaryPhysicalOp rootOp, QueryPlanningInfo qpInfo, PhysicalPlan subplan)
      Creates a physical plan with the given root operator. The given subplan becomes the single child of the root operator.

      The qpInfo argument may be null. Provide an actual QueryPlanningInfo object only if this object already exists and the plan is indeed meant to be associated with it (for instance, when creating a physical plan for a logical plan that is associated with this object). Also, do not create different physical plans with the same QueryPlanningInfo object because these objects may later be extended with additional properties for each plan; instead, make copies of such an object if needed.

    • createPlanWithJoin

      public static PhysicalPlan createPlanWithJoin(PhysicalPlan subplan1, PhysicalPlan subplan2, LogicalToPhysicalOpConverter lop2pop)
      Creates a plan with a binary join as root operator, using the default physical operator for such a join (as per the given LogicalToPhysicalOpConverter).
    • createPlanWithJoin

      public static PhysicalPlan createPlanWithJoin(PhysicalPlan subplan1, PhysicalPlan subplan2, QueryPlanningInfo qpInfo, LogicalToPhysicalOpConverter lop2pop)
      Creates a plan with a binary join as root operator, using the default physical operator for such a join (as per the given LogicalToPhysicalOpConverter).

      The qpInfo argument may be null. Provide an actual QueryPlanningInfo object only if this object already exists and the resulting plan is indeed meant to be associated with it (for instance, when creating a physical plan for a logical plan that is associated with this object). Also, do not create different physical plans with the same QueryPlanningInfo object because these objects may later be extended with additional properties for each plan; instead, make copies of such an object if needed.

    • createPlan

      public static PhysicalPlan createPlan(BinaryLogicalOp rootOp, QueryPlanningInfo qpInfo, LogicalToPhysicalOpConverter lop2pop, PhysicalPlan subplan1, PhysicalPlan subplan2)
      Creates a physical plan in which the root operator is the physical operator that the given LogicalToPhysicalOpConverter returns for the given logical operator. The given subplans become children of the root operator.

      The qpInfo argument may be null. Provide an actual QueryPlanningInfo object only if this object already exists and the plan is indeed meant to be associated with it (for instance, when creating a physical plan for a logical plan that is associated with this object). Also, do not create different physical plans with the same QueryPlanningInfo object because these objects may later be extended with additional properties for each plan; instead, make copies of such an object if needed.

    • createPlan

      public static PhysicalPlan createPlan(BinaryPhysicalOp rootOp, QueryPlanningInfo qpInfo, PhysicalPlan subplan1, PhysicalPlan subplan2)
      Creates a physical plan with the given root operator. The given subplans become children of the root operator.

      The qpInfo argument may be null. Provide an actual QueryPlanningInfo object only if this object already exists and the plan is indeed meant to be associated with it (for instance, when creating a physical plan for a logical plan that is associated with this object). Also, do not create different physical plans with the same QueryPlanningInfo object because these objects may later be extended with additional properties for each plan; instead, make copies of such an object if needed.

    • createPlan

      public static PhysicalPlan createPlan(NaryLogicalOp rootOp, QueryPlanningInfo qpInfo, LogicalToPhysicalOpConverter lop2pop, PhysicalPlan... subplans)
      Creates a physical plan in which the root operator is the physical operator that the given LogicalToPhysicalOpConverter returns for the given logical operator. The given subplans become children of the root operator.

      The qpInfo argument may be null. Provide an actual QueryPlanningInfo object only if this object already exists and the plan is indeed meant to be associated with it (for instance, when creating a physical plan for a logical plan that is associated with this object). Also, do not create different physical plans with the same QueryPlanningInfo object because these objects may later be extended with additional properties for each plan; instead, make copies of such an object if needed.

    • createPlan

      public static PhysicalPlan createPlan(NaryLogicalOp rootOp, QueryPlanningInfo qpInfo, LogicalToPhysicalOpConverter lop2pop, List<PhysicalPlan> subplans)
      Creates a physical plan in which the root operator is the physical operator that the given LogicalToPhysicalOpConverter returns for the given logical operator. The given subplans become children of the root operator.

      The qpInfo argument may be null. Provide an actual QueryPlanningInfo object only if this object already exists and the plan is indeed meant to be associated with it (for instance, when creating a physical plan for a logical plan that is associated with this object). Also, do not create different physical plans with the same QueryPlanningInfo object because these objects may later be extended with additional properties for each plan; instead, make copies of such an object if needed.

    • createPlan

      public static PhysicalPlan createPlan(NaryPhysicalOp rootOp, QueryPlanningInfo qpInfo, PhysicalPlan... subplans)
      Creates a physical plan with the given root operator. The given subplans become children of the root operator.

      The qpInfo argument may be null. Provide an actual QueryPlanningInfo object only if this object already exists and the plan is indeed meant to be associated with it (for instance, when creating a physical plan for a logical plan that is associated with this object). Also, do not create different physical plans with the same QueryPlanningInfo object because these objects may later be extended with additional properties for each plan; instead, make copies of such an object if needed.

    • createPlan

      public static PhysicalPlan createPlan(NaryPhysicalOp rootOp, QueryPlanningInfo qpInfo, List<PhysicalPlan> subplans)
      Creates a physical plan with the given root operator. The given subplans become children of the root operator.

      The qpInfo argument may be null. Provide an actual QueryPlanningInfo object only if this object already exists and the plan is indeed meant to be associated with it (for instance, when creating a physical plan for a logical plan that is associated with this object). Also, do not create different physical plans with the same QueryPlanningInfo object because these objects may later be extended with additional properties for each plan; instead, make copies of such an object if needed.

    • extractRequestAsPlan

      public static PhysicalPlan extractRequestAsPlan(LogicalOpGPAdd gpAdd)
    • extractRequestAsPlan

      public static PhysicalPlan extractRequestAsPlan(PhysicalOpBindJoinBRTPF pop)
    • extractRequestAsPlan

      public static PhysicalPlan extractRequestAsPlan(PhysicalOpBindJoinSPARQL pop)
    • extractRequestAsPlan

      public static PhysicalPlan extractRequestAsPlan(PhysicalOpIndexNestedLoopsJoin pop)
    • extractRequestAsPlan

      public static PhysicalPlan extractRequestAsPlan(UnaryLogicalOp lop)
    • enumeratePlansWithUnaryOpFromReq

      public static List<PhysicalPlan> enumeratePlansWithUnaryOpFromReq(PhysicalOpRequest<?,?> req, PhysicalPlan subplan, LogicalToPhysicalOpConverter lop2pop)
    • createPlanWithUnaryOpForUnionPlan

      public static PhysicalPlan createPlanWithUnaryOpForUnionPlan(PhysicalPlan inputPlan, PhysicalPlan unionPlan, QueryPlanningInfo qpInfo, LogicalToPhysicalOpConverter lop2pop)
      This function takes two physical plans as input, with the assumptions that the second of these plans i) has a union as its root operator and ii) every sub plan under this union is either a request or a filter with a request. Given such input plans, the function turns the requests under the union into gpAdd operators with the first given plan as a common subplan.

      The qpInfo argument may be null. Provide an actual QueryPlanningInfo object only if this object already exists and the resulting plan is indeed meant to be associated with it (for instance, when creating a physical plan for a logical plan that is associated with this object). Also, do not create different physical plans with the same QueryPlanningInfo object because these objects may later be extended with additional properties for each plan; instead, make copies of such an object if needed.

    • createPlanWithDefaultUnaryOpIfPossible

      public static PhysicalPlan createPlanWithDefaultUnaryOpIfPossible(PhysicalPlan inputPlan, PhysicalPlan nextPlan, QueryPlanningInfo qpInfo, LogicalToPhysicalOpConverter lop2pop)
      If the second of the two given plans is either a request, a filter with request, or a union over requests, then this function turns the request(s) into gpAdd operators with the first given plan as subplan. Otherwise, the function returns a plan with a binary join over the two given plans (using the default physical operator).

      The qpInfo argument may be null. Provide an actual QueryPlanningInfo object only if this object already exists and the resulting plan is indeed meant to be associated with it (for instance, when creating a physical plan for a logical plan that is associated with this object). Also, do not create different physical plans with the same QueryPlanningInfo object because these objects may later be extended with additional properties for each plan; instead, make copies of such an object if needed.

    • checkUnaryOpApplicableToUnionPlan

      public static boolean checkUnaryOpApplicableToUnionPlan(PhysicalPlan unionPlan)
      Returns true if the given plan has a union operator as its root operator and all subplans under this union are of one of the following forms: i) a request, ii) a filter over a request, iii) an l2g operator over either a request or a filter with a request.