Class BinaryExecutableOpBase
java.lang.Object
se.liu.ida.hefquin.engine.queryplan.executable.impl.ops.BaseForExecOps
se.liu.ida.hefquin.engine.queryplan.executable.impl.ops.BinaryExecutableOpBase
- All Implemented Interfaces:
StatsProvider
,BinaryExecutableOp
,ExecutableOperator
- Direct Known Subclasses:
ExecOpBinaryUnion
,ExecOpHashJoin
,ExecOpNaiveNestedLoopsJoin
,ExecOpSymmetricHashJoin
Top-level base class for all implementations of
BinaryExecutableOp
.
This base class handles the collection of statistics about both the two
inputs and the processing times per input block from the two inputs. To
this end, it implements the major methods of the BinaryExecutableOp
interface, where the actual functionality to be implemented for these methods
needs to be provided by implementing four abstract functions in each sub-class
of this base class. These four functions are:
_processInputFromChild1(SolutionMapping, IntermediateResultElementSink, ExecutionContext)
,_processInputFromChild2(SolutionMapping, IntermediateResultElementSink, ExecutionContext)
,_wrapUpForChild1(IntermediateResultElementSink, ExecutionContext)
, and_wrapUpForChild2(IntermediateResultElementSink, ExecutionContext)
.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected long
protected long
Fields inherited from class se.liu.ida.hefquin.engine.queryplan.executable.impl.ops.BaseForExecOps
collectExceptions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
_processInputFromChild1
(List<SolutionMapping> inputSolMaps, IntermediateResultElementSink sink, ExecutionContext execCxt) Processes the input solution mappings of the given list by calling_processInputFromChild1(SolutionMapping, IntermediateResultElementSink, ExecutionContext)
for each of them.protected abstract void
_processInputFromChild1
(SolutionMapping inputSolMap, IntermediateResultElementSink sink, ExecutionContext execCxt) Implementations of this function need to process the given solution mapping as input coming from the first operand and send the produced result elements (if any) to the given sink.protected void
_processInputFromChild2
(List<SolutionMapping> inputSolMaps, IntermediateResultElementSink sink, ExecutionContext execCxt) Processes the input solution mappings of the given list by calling_processInputFromChild2(SolutionMapping, IntermediateResultElementSink, ExecutionContext)
for each of them.protected abstract void
_processInputFromChild2
(SolutionMapping inputSolMap, IntermediateResultElementSink sink, ExecutionContext execCxt) Implementations of this function need to process the given solution mapping as input coming from the second operand and send the produced result elements (if any) to the given sink.protected abstract void
_wrapUpForChild1
(IntermediateResultElementSink sink, ExecutionContext execCxt) Implementations of this function need to finish up any processing related to the input coming from the first operand and send the remaining result elements (if any) to the given sink.protected abstract void
_wrapUpForChild2
(IntermediateResultElementSink sink, ExecutionContext execCxt) Implementations of this function need to finish up any processing related to the input coming from the second operand and send the remaining result elements (if any) to the given sink.protected ExecutableOperatorStatsImpl
final ExecutableOperatorStats
getStats()
final void
processInputFromChild1
(List<SolutionMapping> inputSolMaps, IntermediateResultElementSink sink, ExecutionContext execCxt) Processes the solution mappings of the given list as input coming from the first operand and sends the produced result elements (if any) to the given sink.final void
processInputFromChild1
(SolutionMapping inputSolMap, IntermediateResultElementSink sink, ExecutionContext execCxt) Processes the given solution mapping as input coming from the first operand and sends the produced result elements (if any) to the given sink.final void
processInputFromChild2
(List<SolutionMapping> inputSolMaps, IntermediateResultElementSink sink, ExecutionContext execCxt) Processes the solution mappings of the given list as input coming from the second operand and sends the produced result elements (if any) to the given sink.final void
processInputFromChild2
(SolutionMapping inputSolMap, IntermediateResultElementSink sink, ExecutionContext execCxt) Processes the given solution mapping as input coming from the second operand and sends the produced result elements (if any) to the given sink.void
final void
wrapUpForChild1
(IntermediateResultElementSink sink, ExecutionContext execCxt) Finishes up any processing related to the input coming from the first operand and sends the remaining result elements (if any) to the given sink.final void
wrapUpForChild2
(IntermediateResultElementSink sink, ExecutionContext execCxt) Finishes up any processing related to the input coming from the second operand and sends the remaining result elements (if any) to the given sink.Methods inherited from class se.liu.ida.hefquin.engine.queryplan.executable.impl.ops.BaseForExecOps
getExceptionsCaughtDuringExecution, recordExceptionCaughtDuringExecution
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface se.liu.ida.hefquin.engine.queryplan.executable.BinaryExecutableOp
requiresCompleteChild1InputFirst
Methods inherited from interface se.liu.ida.hefquin.engine.queryplan.executable.ExecutableOperator
getExceptionsCaughtDuringExecution
-
Field Details
-
timeAtCurrentLeftProcStart
protected long timeAtCurrentLeftProcStart -
timeAtCurrentRightProcStart
protected long timeAtCurrentRightProcStart
-
-
Constructor Details
-
BinaryExecutableOpBase
public BinaryExecutableOpBase(boolean collectExceptions)
-
-
Method Details
-
processInputFromChild1
public final void processInputFromChild1(SolutionMapping inputSolMap, IntermediateResultElementSink sink, ExecutionContext execCxt) throws ExecOpExecutionException Description copied from interface:BinaryExecutableOp
Processes the given solution mapping as input coming from the first operand and sends the produced result elements (if any) to the given sink.- Specified by:
processInputFromChild1
in interfaceBinaryExecutableOp
- Throws:
ExecOpExecutionException
-
processInputFromChild1
public final void processInputFromChild1(List<SolutionMapping> inputSolMaps, IntermediateResultElementSink sink, ExecutionContext execCxt) throws ExecOpExecutionException Description copied from interface:BinaryExecutableOp
Processes the solution mappings of the given list as input coming from the first operand and sends the produced result elements (if any) to the given sink. The default implementation of this method simply callsBinaryExecutableOp.processInputFromChild1(SolutionMapping, IntermediateResultElementSink, ExecutionContext)
for every solution mapping of the given list Subclasses may override this behavior to send a greater number of output solution mappings to the given sink at a time (which is useful to reduce the communication between threads in the push-based execution model).- Specified by:
processInputFromChild1
in interfaceBinaryExecutableOp
- Throws:
ExecOpExecutionException
-
wrapUpForChild1
public final void wrapUpForChild1(IntermediateResultElementSink sink, ExecutionContext execCxt) throws ExecOpExecutionException Description copied from interface:BinaryExecutableOp
Finishes up any processing related to the input coming from the first operand and sends the remaining result elements (if any) to the given sink. This method will be called only once, after the sub-plan that produces the input coming from the first operand has finished producing its result.- Specified by:
wrapUpForChild1
in interfaceBinaryExecutableOp
- Throws:
ExecOpExecutionException
-
processInputFromChild2
public final void processInputFromChild2(SolutionMapping inputSolMap, IntermediateResultElementSink sink, ExecutionContext execCxt) throws ExecOpExecutionException Description copied from interface:BinaryExecutableOp
Processes the given solution mapping as input coming from the second operand and sends the produced result elements (if any) to the given sink. May throwIllegalStateException
for operators for whichBinaryExecutableOp.requiresCompleteChild1InputFirst()
returns true andBinaryExecutableOp.wrapUpForChild1(IntermediateResultElementSink, ExecutionContext)
has not been called yet.- Specified by:
processInputFromChild2
in interfaceBinaryExecutableOp
- Throws:
ExecOpExecutionException
-
processInputFromChild2
public final void processInputFromChild2(List<SolutionMapping> inputSolMaps, IntermediateResultElementSink sink, ExecutionContext execCxt) throws ExecOpExecutionException Description copied from interface:BinaryExecutableOp
Processes the solution mappings of the given list as input coming from the second operand and sends the produced result elements (if any) to the given sink. The default implementation of this method simply callsBinaryExecutableOp.processInputFromChild2(SolutionMapping, IntermediateResultElementSink, ExecutionContext)
for every solution mapping obtained from the given list. Subclasses may override this behavior to send a greater number of output solution mappings to the given sink at a time (which is useful to reduce the communication between threads in the push-based execution model).- Specified by:
processInputFromChild2
in interfaceBinaryExecutableOp
- Throws:
ExecOpExecutionException
-
wrapUpForChild2
public final void wrapUpForChild2(IntermediateResultElementSink sink, ExecutionContext execCxt) throws ExecOpExecutionException Description copied from interface:BinaryExecutableOp
Finishes up any processing related to the input coming from the second operand and sends the remaining result elements (if any) to the given sink. This method will be called only once, after the sub-plan that produces the input coming from the second operand has finished producing its result. May throwIllegalStateException
for operators for whichBinaryExecutableOp.requiresCompleteChild1InputFirst()
returns true andBinaryExecutableOp.wrapUpForChild1(IntermediateResultElementSink, ExecutionContext)
has not been called yet.- Specified by:
wrapUpForChild2
in interfaceBinaryExecutableOp
- Throws:
ExecOpExecutionException
-
_processInputFromChild1
protected abstract void _processInputFromChild1(SolutionMapping inputSolMap, IntermediateResultElementSink sink, ExecutionContext execCxt) throws ExecOpExecutionException Implementations of this function need to process the given solution mapping as input coming from the first operand and send the produced result elements (if any) to the given sink. If an exception occurs while processing the solution mapping, then this exception needs to be thrown.- Throws:
ExecOpExecutionException
-
_processInputFromChild1
protected void _processInputFromChild1(List<SolutionMapping> inputSolMaps, IntermediateResultElementSink sink, ExecutionContext execCxt) throws ExecOpExecutionException Processes the input solution mappings of the given list by calling_processInputFromChild1(SolutionMapping, IntermediateResultElementSink, ExecutionContext)
for each of them. Subclasses may override this behavior to send a greater number of output solution mappings to the given sink at a time (which is useful to reduce the communication between threads in the push-based execution model). If an exception occurs within the overriding implementation, then this exception needs to be thrown.- Throws:
ExecOpExecutionException
-
_wrapUpForChild1
protected abstract void _wrapUpForChild1(IntermediateResultElementSink sink, ExecutionContext execCxt) throws ExecOpExecutionException Implementations of this function need to finish up any processing related to the input coming from the first operand and send the remaining result elements (if any) to the given sink. If an exception occurs during this process, then this exception needs to be thrown.- Throws:
ExecOpExecutionException
-
_processInputFromChild2
protected abstract void _processInputFromChild2(SolutionMapping inputSolMap, IntermediateResultElementSink sink, ExecutionContext execCxt) throws ExecOpExecutionException Implementations of this function need to process the given solution mapping as input coming from the second operand and send the produced result elements (if any) to the given sink. If an exception occurs while processing the solution mapping, then this exception needs to be thrown. May throw anIllegalStateException
for operators for whichBinaryExecutableOp.requiresCompleteChild1InputFirst()
returns true and_wrapUpForChild1(IntermediateResultElementSink, ExecutionContext)
has not been called yet.- Throws:
ExecOpExecutionException
-
_processInputFromChild2
protected void _processInputFromChild2(List<SolutionMapping> inputSolMaps, IntermediateResultElementSink sink, ExecutionContext execCxt) throws ExecOpExecutionException Processes the input solution mappings of the given list by calling_processInputFromChild2(SolutionMapping, IntermediateResultElementSink, ExecutionContext)
for each of them. Subclasses may override this behavior to send a greater number of output solution mappings to the given sink at a time (which is useful to reduce the communication between threads in the push-based execution model). If an exception occurs within the overriding implementation, then this exception needs to be thrown.- Throws:
ExecOpExecutionException
-
_wrapUpForChild2
protected abstract void _wrapUpForChild2(IntermediateResultElementSink sink, ExecutionContext execCxt) throws ExecOpExecutionException Implementations of this function need to finish up any processing related to the input coming from the second operand and send the remaining result elements (if any) to the given sink. If an exception occurs during this process, then this exception needs to be thrown. May throw anIllegalStateException
for operators for whichBinaryExecutableOp.requiresCompleteChild1InputFirst()
returns true and_wrapUpForChild1(IntermediateResultElementSink, ExecutionContext)
has not been called yet.- Throws:
ExecOpExecutionException
-
resetStats
public void resetStats()- Specified by:
resetStats
in interfaceStatsProvider
-
getStats
- Specified by:
getStats
in interfaceExecutableOperator
- Specified by:
getStats
in interfaceStatsProvider
-
createStats
-