Class LogicalToPhysicalOpConverterImpl

java.lang.Object
se.liu.ida.hefquin.engine.queryplan.utils.LogicalToPhysicalOpConverterImpl
All Implemented Interfaces:
LogicalToPhysicalOpConverter

public class LogicalToPhysicalOpConverterImpl extends Object implements LogicalToPhysicalOpConverter
This class provides methods to convert logical operators into physical operators by using the respective default type of physical operator for each type of logical operator.
  • Constructor Details

    • LogicalToPhysicalOpConverterImpl

      public LogicalToPhysicalOpConverterImpl(List<PhysicalOpFactory> popFactories)
  • Method Details

    • convert

      public NullaryPhysicalOp convert(NullaryLogicalOp lop)
      Description copied from interface: LogicalToPhysicalOpConverter
      Returns a physical operator that implements the given logical operator. If this converter knows of multiple types of physical operators that may be used for the given logical operator, then the default type is used. If this converter does not know of any type of physical operator that may be used for the given logical operator, then an UnsupportedOperationException is thrown.
      Specified by:
      convert in interface LogicalToPhysicalOpConverter
      Parameters:
      lop - - the logical operator to be converted
      Returns:
      a physical operator for the given logical operator
    • getAllPossible

      public Set<NullaryPhysicalOp> getAllPossible(NullaryLogicalOp lop)
      Description copied from interface: LogicalToPhysicalOpConverter
      Returns all physical operators that implement the given logical operator.
      Specified by:
      getAllPossible in interface LogicalToPhysicalOpConverter
      Parameters:
      lop - - the logical operator to be converted
      Returns:
      a set of all possible physical operators for the given logical operator; the set may be empty
    • convert

      public UnaryPhysicalOp convert(UnaryLogicalOp lop, ExpectedVariables inputVars)
      Description copied from interface: LogicalToPhysicalOpConverter
      Returns a physical operator that implements the given logical operator under the assumption that this operator will be used in a plan in which the subplan under this operator will produce solution mappings with the given variables.

      If this converter knows of multiple types of physical operators that may be applied in this case, then the default type is used. If this converter does not know of any type of physical operator that may be applied in this case, then an UnsupportedOperationException is thrown.

      Specified by:
      convert in interface LogicalToPhysicalOpConverter
      Parameters:
      lop - - the logical operator to be converted
      inputVars - - the variables that can be expected to be bound in solution mappings that the physical operator will have to process
      Returns:
      a physical operator for the given logical operator
    • getAllPossible

      public Set<UnaryPhysicalOp> getAllPossible(UnaryLogicalOp lop, ExpectedVariables inputVars)
      Description copied from interface: LogicalToPhysicalOpConverter
      Returns all physical operators that implement the given logical operator under the assumption that this operator will be used in a plan in which the subplan under this operator will produce solution mappings with the given variables.
      Specified by:
      getAllPossible in interface LogicalToPhysicalOpConverter
      Parameters:
      lop - - the logical operator to be converted
      inputVars - - the variables that can be expected to be bound in solution mappings that the physical operator will have to process
      Returns:
      a set of all possible physical operators for the given logical operator; the set may be empty
    • convert

      public BinaryPhysicalOp convert(BinaryLogicalOp lop, ExpectedVariables inputVars1, ExpectedVariables inputVars2)
      Description copied from interface: LogicalToPhysicalOpConverter
      Returns a physical operator that implements the given logical operator under the assumption that this operator will be used in a plan in which the two subplans under this operator will produce solution mappings with the given variables, respectively.

      If this converter knows of multiple types of physical operators that may be applied in this case, then the default type is used. If this converter does not know of any type of physical operator that may be applied in this case, then an UnsupportedOperationException is thrown.

      Specified by:
      convert in interface LogicalToPhysicalOpConverter
      Parameters:
      lop - - the logical operator to be converted
      inputVars1 - - the variables that can be expected to be bound in solution mappings that the physical operator will have to process as its left input
      inputVars2 - - the variables that can be expected to be bound in solution mappings that the physical operator will have to process as its right input
      Returns:
      a physical operator for the given logical operator
    • getAllPossible

      public Set<BinaryPhysicalOp> getAllPossible(BinaryLogicalOp lop, ExpectedVariables inputVars1, ExpectedVariables inputVars2)
      Description copied from interface: LogicalToPhysicalOpConverter
      Returns all physical operators that implement the given logical operator under the assumption that this operator will be used in a plan in which the two subplans under this operator will produce solution mappings with the given variables, respectively.
      Specified by:
      getAllPossible in interface LogicalToPhysicalOpConverter
      Parameters:
      lop - - the logical operator to be converted
      inputVars1 - - the variables that can be expected to be bound in solution mappings that the physical operator will have to process as its left input
      inputVars2 - - the variables that can be expected to be bound in solution mappings that the physical operator will have to process as its right input
      Returns:
      a set of all possible physical operators for the given logical operator; the set may be empty
    • convert

      public NaryPhysicalOp convert(NaryLogicalOp lop, ExpectedVariables... inputVars)
      Description copied from interface: LogicalToPhysicalOpConverter
      Returns a physical operator that implements the given logical operator under the assumption that this operator will be used in a plan in which the subplans under this operator will produce solution mappings with the given variables, respectively.

      If this converter knows of multiple types of physical operators that may be applied in this case, then the default type is used. If this converter does not know of any type of physical operator that may be applied in this case, then an UnsupportedOperationException is thrown.

      Specified by:
      convert in interface LogicalToPhysicalOpConverter
      Parameters:
      lop - - the logical operator to be converted
      inputVars - - the variables that can be expected to be bound in solution mappings that the physical operator will have to process for each of its inputs
      Returns:
      a physical operator for the given logical operator
    • getAllPossible

      public Set<NaryPhysicalOp> getAllPossible(NaryLogicalOp lop, ExpectedVariables... inputVars)
      Description copied from interface: LogicalToPhysicalOpConverter
      Returns all physical operators that implement the given logical operator under the assumption that this operator will be used in a plan in which the subplans under this operator will produce solution mappings with the given variables, respectively.
      Specified by:
      getAllPossible in interface LogicalToPhysicalOpConverter
      Parameters:
      lop - - the logical operator to be converted
      inputVars - - the variables that can be expected to be bound in solution mappings that the physical operator will have to process for each of its inputs
      Returns:
      a set of all possible physical operators for the given logical operator; the set may be empty