Class BaseRootExec
java.lang.Object
org.apache.drill.exec.physical.impl.BaseRootExec
- All Implemented Interfaces:
AutoCloseable
,RootExec
- Direct Known Subclasses:
BroadcastSenderRootExec
,PartitionSenderRootExec
,ScreenCreator.ScreenRoot
,SingleSenderCreator.SingleSenderRootExec
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
protected RootFragmentContext
protected OperatorContext
protected OperatorStats
-
Constructor Summary
ConstructorDescriptionBaseRootExec
(RootFragmentContext fragmentContext, OperatorContext oContext, PhysicalOperator config) BaseRootExec
(RootFragmentContext fragmentContext, PhysicalOperator config) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
Dump failed batches' state preceded by its parent's state to logs.static <T> T
Given a list of operators and a stack trace, walks the stack trace and the operator list to find the leaf-most operator, which is the one that was active when the exception was thrown.abstract boolean
final boolean
next()
Do the next batch of work.final RecordBatch.IterOutcome
next
(RecordBatch b) void
Inform sender that receiving fragment is finished and doesn't need any more data.
-
Field Details
-
ENABLE_BATCH_DUMP_CONFIG
- See Also:
-
stats
-
oContext
-
fragmentContext
-
-
Constructor Details
-
BaseRootExec
public BaseRootExec(RootFragmentContext fragmentContext, PhysicalOperator config) throws OutOfMemoryException - Throws:
OutOfMemoryException
-
BaseRootExec
public BaseRootExec(RootFragmentContext fragmentContext, OperatorContext oContext, PhysicalOperator config) throws OutOfMemoryException - Throws:
OutOfMemoryException
-
-
Method Details
-
next
public final boolean next()Description copied from interface:RootExec
Do the next batch of work. -
next
-
innerNext
public abstract boolean innerNext() -
receivingFragmentFinished
Description copied from interface:RootExec
Inform sender that receiving fragment is finished and doesn't need any more data. This can be called multiple times (once for each downstream receiver). If all receivers are finished then a subsequent call toRootExec.next()
will return false.- Specified by:
receivingFragmentFinished
in interfaceRootExec
- Parameters:
handle
- The handle pointing to the downstream receiver that does not need anymore data.
-
dumpBatches
Description copied from interface:RootExec
Dump failed batches' state preceded by its parent's state to logs. Invoked when there is a failure during fragment execution.- Specified by:
dumpBatches
in interfaceRootExec
- Parameters:
t
- the exception thrown by an operator and which therefore records, in its stack trace, which operators were active on the stack
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
findLeaf
Given a list of operators and a stack trace, walks the stack trace and the operator list to find the leaf-most operator, which is the one that was active when the exception was thrown. Handle the cases in which no operator was active, each operator had multiple methods on the stack, or the exception was thrown in some class called by the operator.Not all operators leave a mark in the trace. In particular if a the call stack is only through base-class methods, then we have no way to know the actual class during the call. This is OK because the leaf methods are just pass-through operations, they are unlikely to fail.
- Type Parameters:
T
- the type of the operator. Parameterized to allow easier testing- Parameters:
dag
- the list of operators from root-most to leaf-moste
- the exception thrown somewhere in the operator tree- Returns:
- the leaf-most operator, if any
-