Class BaseForUnaryExecOpWithCollectedInput
java.lang.Object
se.liu.ida.hefquin.engine.queryplan.executable.impl.ops.BaseForExecOps
se.liu.ida.hefquin.engine.queryplan.executable.impl.ops.UnaryExecutableOpBase
se.liu.ida.hefquin.engine.queryplan.executable.impl.ops.BaseForUnaryExecOpWithCollectedInput
- All Implemented Interfaces:
StatsProvider,ExecutableOperator,UnaryExecutableOp
- Direct Known Subclasses:
BaseForExecOpIndexNestedLoopsJoinWithRequestOps,BaseForExecOpIndexNestedLoopsJoinWithRequests,BaseForExecOpParallelBindJoin,ExecOpLookupJoinViaWrapperWithParamVars,ExecOpParallelMultiwayLeftJoin
Base class for all implementations of
UnaryExecutableOp that
work more effectively if at least a minimum number of input solution
mappings are available to process. To this end, the functionality of
this base class is to collect the input solution mappings until there
are at least as many as specified by the minimumCollectionSize
argument of the constructor and, then, pass the resulting batch of
collected input solution mappings to the _processCollectedInput
function implemented by the operator that is implemented as an extension
of this base class. If further input solution mappings arrive after that,
then these are collected again, and so on.
Notice that the specified minimumCollectionSize is only a lower
bound; if multiple input solution mapping arrive at the same time, they
are all added into the current collection, which may result in collections
that contain (many) more than the minimum number of solution mappings.
Classes that extend this base class need to implement two functions:
-
Field Summary
FieldsFields inherited from class se.liu.ida.hefquin.engine.queryplan.executable.impl.ops.BaseForExecOps
collectExceptions, qpInfo -
Constructor Summary
ConstructorsConstructorDescriptionBaseForUnaryExecOpWithCollectedInput(int minimumCollectionSize, boolean collectExceptions, QueryPlanningInfo qpInfo) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void_concludeExecution(List<SolutionMapping> currentBatch, IntermediateResultElementSink sink, ExecutionContext execCxt) Implementations of this function need to process the given solution mappings as last input, conclude the execution of this operator, and send the remaining result elements (if any) to the given sink.protected final void_concludeExecution(IntermediateResultElementSink sink, ExecutionContext execCxt) Implementations of this function need to conclude the execution of this operator and send the remaining result elements (if any) to the given sink.protected final void_process(List<SolutionMapping> inputSolMaps, IntermediateResultElementSink sink, ExecutionContext execCxt) Processes the input solution mappings of the given list by callingUnaryExecutableOpBase._process(SolutionMapping, IntermediateResultElementSink, ExecutionContext)for each of them.protected final void_process(SolutionMapping inputSolMap, IntermediateResultElementSink sink, ExecutionContext execCxt) Implementations of this function need to process the given solution mapping as input and send the produced result elements (if any) to the given sink.protected abstract void_processCollectedInput(List<SolutionMapping> currentBatch, IntermediateResultElementSink sink, ExecutionContext execCxt) Implementations of this function need to process the given solution mappings as input and send the produced result elements (if any) to the given sink.protected ExecutableOperatorStatsImplvoidMethods inherited from class se.liu.ida.hefquin.engine.queryplan.executable.impl.ops.UnaryExecutableOpBase
concludeExecution, getStats, process, processMethods inherited from class se.liu.ida.hefquin.engine.queryplan.executable.impl.ops.BaseForExecOps
getExceptionsCaughtDuringExecution, getQueryPlanningInfo, recordExceptionCaughtDuringExecutionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface se.liu.ida.hefquin.engine.queryplan.executable.ExecutableOperator
getExceptionsCaughtDuringExecution, getQueryPlanningInfo
-
Field Details
-
minimumCollectionSize
protected final int minimumCollectionSize -
collectedInputSolMaps
-
-
Constructor Details
-
BaseForUnaryExecOpWithCollectedInput
public BaseForUnaryExecOpWithCollectedInput(int minimumCollectionSize, boolean collectExceptions, QueryPlanningInfo qpInfo)
-
-
Method Details
-
_process
protected final void _process(SolutionMapping inputSolMap, IntermediateResultElementSink sink, ExecutionContext execCxt) throws ExecOpExecutionException Description copied from class:UnaryExecutableOpBaseImplementations of this function need to process the given solution mapping as input 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.- Specified by:
_processin classUnaryExecutableOpBase- Throws:
ExecOpExecutionException
-
_process
protected final void _process(List<SolutionMapping> inputSolMaps, IntermediateResultElementSink sink, ExecutionContext execCxt) throws ExecOpExecutionException Description copied from class:UnaryExecutableOpBaseProcesses the input solution mappings of the given list by callingUnaryExecutableOpBase._process(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.- Overrides:
_processin classUnaryExecutableOpBase- Throws:
ExecOpExecutionException
-
_concludeExecution
protected final void _concludeExecution(IntermediateResultElementSink sink, ExecutionContext execCxt) throws ExecOpExecutionException Description copied from class:UnaryExecutableOpBaseImplementations of this function need to conclude the execution of this operator 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.- Specified by:
_concludeExecutionin classUnaryExecutableOpBase- Throws:
ExecOpExecutionException
-
_processCollectedInput
protected abstract void _processCollectedInput(List<SolutionMapping> currentBatch, IntermediateResultElementSink sink, ExecutionContext execCxt) throws ExecOpExecutionException Implementations of this function need to process the given solution mappings as input and send the produced result elements (if any) to the given sink. If an exception occurs while processing the solution mappings, then this exception needs to be thrown.- Throws:
ExecOpExecutionException
-
_concludeExecution
protected abstract void _concludeExecution(List<SolutionMapping> currentBatch, IntermediateResultElementSink sink, ExecutionContext execCxt) throws ExecOpExecutionException Implementations of this function need to process the given solution mappings as last input, conclude the execution of this operator, and send the remaining result elements (if any) to the given sink. Notice that the list of solution mappings given here may contain fewer solution mappings than the minimum collection size, and it may even be empty! If an exception occurs during this process, then this exception needs to be thrown.- Throws:
ExecOpExecutionException
-
resetStats
public void resetStats()- Specified by:
resetStatsin interfaceStatsProvider- Overrides:
resetStatsin classUnaryExecutableOpBase
-
createStats
- Overrides:
createStatsin classUnaryExecutableOpBase
-