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 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) <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.void
injectUnchecked
(String desc) Insert an unchecked fault (exception).newFileSystem
(org.apache.hadoop.conf.Configuration conf) newNonTrackingFileSystem
(org.apache.hadoop.conf.Configuration conf) <RESULT> org.apache.drill.shaded.guava.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.void
setInjector
(ControlsInjector injector)
-
Method Details
-
getOperatorDefn
Return the physical operator definition created by the planner and passed into the Drillbit executing the query.- Returns:
- the physical operator definition
-
getAllocator
BufferAllocator getAllocator()Return the memory allocator for this operator.- Returns:
- the per-operator memory allocator
-
getFragmentContext
FragmentContext getFragmentContext() -
replace
-
getManagedBuffer
DrillBuf getManagedBuffer() -
getManagedBuffer
-
getExecutionControls
ExecutionControls getExecutionControls() -
getStats
OperatorStats getStats()Drill statistics mechanism. Allows operators to update statistics.- Returns:
- operator statistics
-
getExecutor
ExecutorService getExecutor() -
getScanExecutor
ExecutorService getScanExecutor() -
getScanDecodeExecutor
ExecutorService getScanDecodeExecutor() -
newFileSystem
- Throws:
IOException
-
newNonTrackingFileSystem
DrillFileSystem newNonTrackingFileSystem(org.apache.hadoop.conf.Configuration conf) throws IOException - Throws:
IOException
-
runCallableAs
<RESULT> org.apache.drill.shaded.guava.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 informationcallable
- callable to run- Returns:
- Future
future with the result of calling the callable
-
setInjector
-
getInjector
ControlsInjector getInjector()Returns the fault injection mechanism used to introduce faults at runtime for testing.- Returns:
- the fault injector
-
injectUnchecked
Insert 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
-
injectChecked
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.- 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
void close()
-