Package org.apache.drill.exec.ops
Class BaseOperatorContext
java.lang.Object
org.apache.drill.exec.ops.BaseOperatorContext
- All Implemented Interfaces:
OperatorContext
Implementation of
OperatorContext
that provides services
needed by most run-time operators. Excludes services that need the
entire Drillbit. This class provides services common to the test-time
version of the operator context and the full production-time context
that includes network services.-
Field Summary
Modifier and TypeFieldDescriptionprotected final BufferAllocator
protected final FragmentContext
protected final BufferManager
protected final PhysicalOperator
-
Constructor Summary
ConstructorDescriptionBaseOperatorContext
(FragmentContext context, BufferAllocator allocator, PhysicalOperator popConfig) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Return the memory allocator for this operator.Returns the fault injection mechanism used to introduce faults at runtime for testing.getManagedBuffer
(int size) getName()
<T extends PhysicalOperator>
TReturn the physical operator definition created by the planner and passed into the Drillbit executing the query.<T extends Throwable>
voidinjectChecked
(String desc, Class<T> exceptionClass) Insert a checked fault (exception) of the given class.void
injectUnchecked
(String desc) Insert an unchecked fault (exception).newFileSystem
(org.apache.hadoop.conf.Configuration conf) Creates DrillFileSystem that automatically tracks operator stats.newNonTrackingFileSystem
(org.apache.hadoop.conf.Configuration conf) Creates a DrillFileSystem that does not automatically track operator stats.void
setInjector
(ControlsInjector injector) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.drill.exec.ops.OperatorContext
getStats, runCallableAs
-
Field Details
-
context
-
allocator
-
popConfig
-
manager
-
-
Constructor Details
-
BaseOperatorContext
public BaseOperatorContext(FragmentContext context, BufferAllocator allocator, PhysicalOperator popConfig)
-
-
Method Details
-
getFragmentContext
- Specified by:
getFragmentContext
in interfaceOperatorContext
-
getOperatorDefn
Description copied from interface:OperatorContext
Return the physical operator definition created by the planner and passed into the Drillbit executing the query.- Specified by:
getOperatorDefn
in interfaceOperatorContext
- Returns:
- the physical operator definition
-
getName
-
replace
- Specified by:
replace
in interfaceOperatorContext
-
getManagedBuffer
- Specified by:
getManagedBuffer
in interfaceOperatorContext
-
getManagedBuffer
- Specified by:
getManagedBuffer
in interfaceOperatorContext
-
getExecutionControls
- Specified by:
getExecutionControls
in interfaceOperatorContext
-
getAllocator
Description copied from interface:OperatorContext
Return the memory allocator for this operator.- Specified by:
getAllocator
in interfaceOperatorContext
- Returns:
- the per-operator memory allocator
-
getExecutor
- Specified by:
getExecutor
in interfaceOperatorContext
-
getScanExecutor
- Specified by:
getScanExecutor
in interfaceOperatorContext
-
getScanDecodeExecutor
- Specified by:
getScanDecodeExecutor
in interfaceOperatorContext
-
setInjector
- Specified by:
setInjector
in interfaceOperatorContext
-
getInjector
Description copied from interface:OperatorContext
Returns the fault injection mechanism used to introduce faults at runtime for testing.- Specified by:
getInjector
in interfaceOperatorContext
- Returns:
- the fault injector
-
injectUnchecked
Description copied from interface:OperatorContext
Insert an unchecked fault (exception). Handles the details of checking if fault injection is enabled and this particular fault is selected.- Specified by:
injectUnchecked
in interfaceOperatorContext
- Parameters:
desc
- the description of the fault used to match a fault injection parameter to determine if the fault should be injected
-
injectChecked
Description copied from interface:OperatorContext
Insert a checked fault (exception) of the given class. Handles the details of checking if fault injection is enabled and this particular fault is selected.- Specified by:
injectChecked
in interfaceOperatorContext
- Parameters:
desc
- the description of the fault used to match a fault injection parameter to determine if the fault should be injectedexceptionClass
- the class of exeception to be thrown- Throws:
T
- if the fault is enabled
-
close
public void close()- Specified by:
close
in interfaceOperatorContext
-
newFileSystem
Creates DrillFileSystem that automatically tracks operator stats. Only one tracking and no non-tracking file system per operator context.- Specified by:
newFileSystem
in interfaceOperatorContext
- Throws:
IOException
-
newNonTrackingFileSystem
public DrillFileSystem newNonTrackingFileSystem(org.apache.hadoop.conf.Configuration conf) throws IOException Creates a DrillFileSystem that does not automatically track operator stats. Multiple non-tracking file system are allowed.- Specified by:
newNonTrackingFileSystem
in interfaceOperatorContext
- Throws:
IOException
-