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 Details

    • getOperatorDefn

      <T extends PhysicalOperator> T 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

      DrillBuf replace(DrillBuf old, int newSize)
    • getManagedBuffer

      DrillBuf getManagedBuffer()
    • getManagedBuffer

      DrillBuf getManagedBuffer(int size)
    • 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

      DrillFileSystem newFileSystem(org.apache.hadoop.conf.Configuration conf) throws IOException
      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 information
      callable - callable to run
      Returns:
      Future future with the result of calling the callable
    • setInjector

      void setInjector(ControlsInjector injector)
    • getInjector

      ControlsInjector getInjector()
      Returns the fault injection mechanism used to introduce faults at runtime for testing.
      Returns:
      the fault injector
    • injectUnchecked

      void injectUnchecked(String desc)
      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

      <T extends Throwable> void injectChecked(String desc, Class<T> exceptionClass) throws T
      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 injected
      exceptionClass - the class of exeception to be thrown
      Throws:
      T - if the fault is enabled
    • close

      void close()