Class PhysicalOpRegistry
java.lang.Object
se.liu.ida.hefquin.engine.queryplan.physical.PhysicalOpRegistry
Class used to create physical operators (
PhysicalOperator) from
logical operators (LogicalOperator) by consulting a registry of
factories (PhysicalOpFactory).
Factories are queried in the order they were registered. The first factory
that supports the operator given the provided input variables is used to create
the physical operator.
All factories should be registered during initialization.
If no registered factory supports the given inputs, the registry throws
UnsupportedOperationException.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate(BinaryLogicalOp lop, ExpectedVariables inputVars1, ExpectedVariables inputVars2) Creates a physical operator for the given logical operator by consulting registered factories in order.create(NaryLogicalOp lop, ExpectedVariables... inputVars) Creates a physical operator for the given logical operator by consulting registered factories in order.create(NullaryLogicalOp lop) Creates a physical operator for the given logical operator by consulting registered factories in order.create(UnaryLogicalOp lop, ExpectedVariables inputVars) Creates a physical operator for the given logical operator by consulting registered factories in order.createAll(BinaryLogicalOp lop, ExpectedVariables inputVars1, ExpectedVariables inputVars2) Creates all possible physical operators for the given logical operator by consulting all registered factories.createAll(NaryLogicalOp lop, ExpectedVariables... inputVars) Creates all possible physical operators for the given logical operator by consulting all registered factories.Creates all possible physical operators for the given logical operator by consulting all registered factories.createAll(UnaryLogicalOp lop, ExpectedVariables inputVars) Creates all possible physical operators for the given logical operator by consulting all registered factories.register(PhysicalOpFactory factory) Registers a factory at the end of the lookup chain.
-
Constructor Details
-
PhysicalOpRegistry
public PhysicalOpRegistry()
-
-
Method Details
-
register
Registers a factory at the end of the lookup chain.- Parameters:
factory- the factory to add- Returns:
- this registry (for chaining)
-
create
Creates a physical operator for the given logical operator by consulting registered factories in order. If no registered factory supports the given inputs, anUnsupportedOperationExceptionis thrown.- Parameters:
lop- logical operator- Returns:
- the operator produced by the first supporting factory
- Throws:
NoSuchElementException- if no factory supports the inputs
-
create
Creates a physical operator for the given logical operator by consulting registered factories in order. If no registered factory supports the given inputs, anUnsupportedOperationExceptionis thrown.- Parameters:
lop- logical operatorinputVars- expected input variables- Returns:
- the operator produced by the first supporting factory
- Throws:
NoSuchElementException- if no factory supports the inputs
-
create
public BinaryPhysicalOp create(BinaryLogicalOp lop, ExpectedVariables inputVars1, ExpectedVariables inputVars2) Creates a physical operator for the given logical operator by consulting registered factories in order. If no registered factory supports the given inputs, anUnsupportedOperationExceptionis thrown.- Parameters:
lop- logical operatorinputVars1- - the variables that can be expected to be bound in solution mappings that the physical operator will have to process as its left inputinputVars2- - 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:
- the operator produced by the first supporting factory
- Throws:
NoSuchElementException- if no factory supports the inputs
-
create
Creates a physical operator for the given logical operator by consulting registered factories in order. If no registered factory supports the given inputs, anUnsupportedOperationExceptionis thrown.- Parameters:
lop- logical operatorinputVars- - 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:
- the operator produced by the first supporting factory
- Throws:
NoSuchElementException- if no factory supports the inputs
-
createAll
Creates all possible physical operators for the given logical operator by consulting all registered factories. If no registered factory supports the given inputs, the returned set is empty.- Parameters:
lop- logical operatorinputVars- expected input variables- Returns:
- the operators produced by all supporting factories
-
createAll
Creates all possible physical operators for the given logical operator by consulting all registered factories. If no registered factory supports the given inputs, the returned set is empty.- Parameters:
lop- logical operatorinputVars- expected input variables- Returns:
- the operators produced by all supporting factories
-
createAll
public Set<BinaryPhysicalOp> createAll(BinaryLogicalOp lop, ExpectedVariables inputVars1, ExpectedVariables inputVars2) Creates all possible physical operators for the given logical operator by consulting all registered factories. If no registered factory supports the given inputs, the returned set is empty.- Parameters:
lop- logical operatorinputVars- expected input variables- Returns:
- the operators produced by all supporting factories
-
createAll
Creates all possible physical operators for the given logical operator by consulting all registered factories. If no registered factory supports the given inputs, the returned set is empty.- Parameters:
lop- logical operatorinputVars- expected input variables- Returns:
- the operators produced by all supporting factories
-