Class UnaryExecutableOpBaseWithoutBlocking
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.UnaryExecutableOpBaseWithoutBlocking
- All Implemented Interfaces:
StatsProvider,ExecutableOperator,UnaryExecutableOp
- Direct Known Subclasses:
ExecOpBind,ExecOpFilter,ExecOpGlobalToLocal,ExecOpLocalToGlobal
Base class for all implementations of
UnaryExecutableOp that do not
need to process the input solution mappings in batches (the filter operator
is a typical example). For such operators, this base class implements the
_process(List, IntermediateResultElementSink, ExecutionContext)
method in a way that the given list is still consumed in batches, where
each batch is processed by the
_process(Iterator, int, IntermediateResultElementSink, ExecutionContext)
method. Classes that extend this base class should override this method.
The purpose of consuming the input list of solution mappings in batches is
to increase inter-operator parallelism in the executable plans, in particular
in cases in which the input list is huge. If such a huge input list was first
processed completely to collect all the output solution mappings for the
parent operator in the plan, then the parent operator may idle. Of course,
it is also possible to directly send all output solution mappings individually
to the parent operator, but that should be avoided to reduce the communication
between the threads that run these operators.-
Field Summary
FieldsFields inherited from class se.liu.ida.hefquin.engine.queryplan.executable.impl.ops.BaseForExecOps
collectExceptions, qpInfo -
Constructor Summary
ConstructorsConstructorDescriptionUnaryExecutableOpBaseWithoutBlocking(boolean collectExceptions, QueryPlanningInfo qpInfo) -
Method Summary
Modifier and TypeMethodDescriptionprotected void_process(Iterator<SolutionMapping> inputSolMaps, int maxBatchSize, IntermediateResultElementSink sink, ExecutionContext execCxt) Processes input solution mappings of the given iterator by callingUnaryExecutableOpBase._process(SolutionMapping, IntermediateResultElementSink, ExecutionContext)for each of them, but consumes only as many input solution mappings as specified by the maxBatchSize argument (or less if the given iterator is exhausted earlier).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.Methods inherited from class se.liu.ida.hefquin.engine.queryplan.executable.impl.ops.UnaryExecutableOpBase
_concludeExecution, _process, concludeExecution, createStats, getStats, process, process, resetStatsMethods 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
-
MAX_BATCH_SIZE
public static final int MAX_BATCH_SIZE- See Also:
-
-
Constructor Details
-
UnaryExecutableOpBaseWithoutBlocking
-
-
Method Details
-
_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
-
_process
protected void _process(Iterator<SolutionMapping> inputSolMaps, int maxBatchSize, IntermediateResultElementSink sink, ExecutionContext execCxt) throws ExecOpExecutionException Processes input solution mappings of the given iterator by callingUnaryExecutableOpBase._process(SolutionMapping, IntermediateResultElementSink, ExecutionContext)for each of them, but consumes only as many input solution mappings as specified by the maxBatchSize argument (or less if the given iterator is exhausted earlier). 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). Yet, overriding implementations should not call the given iterator more often as specified by the maxBatchSize argument. If an exception occurs within the overriding implementation, then this exception needs to be thrown.- Throws:
ExecOpExecutionException
-