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
FieldsModifier and TypeFieldDescriptionprotected final BufferAllocatorprotected final FragmentContextprotected final BufferManagerprotected final PhysicalOperator -
Constructor Summary
ConstructorsConstructorDescriptionBaseOperatorContext(FragmentContext context, BufferAllocator allocator, PhysicalOperator popConfig) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()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.voidinjectUnchecked(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.voidsetInjector(ControlsInjector injector) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
getFragmentContextin interfaceOperatorContext
-
getOperatorDefn
Description copied from interface:OperatorContextReturn the physical operator definition created by the planner and passed into the Drillbit executing the query.- Specified by:
getOperatorDefnin interfaceOperatorContext- Returns:
- the physical operator definition
-
getName
-
replace
- Specified by:
replacein interfaceOperatorContext
-
getManagedBuffer
- Specified by:
getManagedBufferin interfaceOperatorContext
-
getManagedBuffer
- Specified by:
getManagedBufferin interfaceOperatorContext
-
getExecutionControls
- Specified by:
getExecutionControlsin interfaceOperatorContext
-
getAllocator
Description copied from interface:OperatorContextReturn the memory allocator for this operator.- Specified by:
getAllocatorin interfaceOperatorContext- Returns:
- the per-operator memory allocator
-
getExecutor
- Specified by:
getExecutorin interfaceOperatorContext
-
getScanExecutor
- Specified by:
getScanExecutorin interfaceOperatorContext
-
getScanDecodeExecutor
- Specified by:
getScanDecodeExecutorin interfaceOperatorContext
-
setInjector
- Specified by:
setInjectorin interfaceOperatorContext
-
getInjector
Description copied from interface:OperatorContextReturns the fault injection mechanism used to introduce faults at runtime for testing.- Specified by:
getInjectorin interfaceOperatorContext- Returns:
- the fault injector
-
injectUnchecked
Description copied from interface:OperatorContextInsert an unchecked fault (exception). Handles the details of checking if fault injection is enabled and this particular fault is selected.- Specified by:
injectUncheckedin 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:OperatorContextInsert 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:
injectCheckedin 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:
closein interfaceOperatorContext
-
newFileSystem
Creates DrillFileSystem that automatically tracks operator stats. Only one tracking and no non-tracking file system per operator context.- Specified by:
newFileSystemin 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:
newNonTrackingFileSystemin interfaceOperatorContext- Throws:
IOException
-