Package org.apache.drill.exec.ops
Interface OperatorContext
- All Known Implementing Classes:
- BaseOperatorContext
public interface OperatorContext
Per-operator services available for operator implementations.
 The services allow access to the operator definition, to the
 fragment context, and to per-operator services.
 
Use this interface in code to allow unit tests to provide test-time implementations of this context.
- 
Method SummaryModifier 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) <T extends PhysicalOperator>
 TReturn the physical operator definition created by the planner and passed into the Drillbit executing the query.getStats()Drill statistics mechanism.<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) newNonTrackingFileSystem(org.apache.hadoop.conf.Configuration conf) <RESULT> com.google.common.util.concurrent.ListenableFuture<RESULT> runCallableAs(org.apache.hadoop.security.UserGroupInformation proxyUgi, Callable<RESULT> callable) Run the callable as the given proxy user.voidsetInjector(ControlsInjector injector) 
- 
Method Details- 
getOperatorDefnReturn the physical operator definition created by the planner and passed into the Drillbit executing the query.- Returns:
- the physical operator definition
 
- 
getAllocatorBufferAllocator getAllocator()Return the memory allocator for this operator.- Returns:
- the per-operator memory allocator
 
- 
getFragmentContextFragmentContext getFragmentContext()
- 
replace
- 
getManagedBufferDrillBuf getManagedBuffer()
- 
getManagedBuffer
- 
getExecutionControlsExecutionControls getExecutionControls()
- 
getStatsOperatorStats getStats()Drill statistics mechanism. Allows operators to update statistics.- Returns:
- operator statistics
 
- 
getExecutorExecutorService getExecutor()
- 
getScanExecutorExecutorService getScanExecutor()
- 
getScanDecodeExecutorExecutorService getScanDecodeExecutor()
- 
newFileSystem- Throws:
- IOException
 
- 
newNonTrackingFileSystemDrillFileSystem newNonTrackingFileSystem(org.apache.hadoop.conf.Configuration conf) throws IOException - Throws:
- IOException
 
- 
runCallableAs<RESULT> com.google.common.util.concurrent.ListenableFuture<RESULT> runCallableAs(org.apache.hadoop.security.UserGroupInformation proxyUgi, Callable<RESULT> callable) Run the callable as the given proxy user.- Type Parameters:
- RESULT- result type
- Parameters:
- proxyUgi- proxy user group information
- callable- callable to run
- Returns:
- Futurefuture with the result of calling the callable 
 
- 
setInjector
- 
getInjectorControlsInjector getInjector()Returns the fault injection mechanism used to introduce faults at runtime for testing.- Returns:
- the fault injector
 
- 
injectUncheckedInsert an unchecked fault (exception). Handles the details of checking if fault injection is enabled and this particular fault is selected.- Parameters:
- desc- the description of the fault used to match a fault injection parameter to determine if the fault should be injected
- Throws:
- RuntimeException- an unchecked exception if the fault is enabled
 
- 
injectCheckedInsert a checked fault (exception) of the given class. Handles the details of checking if fault injection is enabled and this particular fault is selected.- Parameters:
- desc- the description of the fault used to match a fault injection parameter to determine if the fault should be injected
- exceptionClass- the class of exeception to be thrown
- Throws:
- T- if the fault is enabled
 
- 
closevoid close()
 
-