Class SerializedExecutor

java.lang.Object
org.apache.drill.common.SerializedExecutor
All Implemented Interfaces:
Executor

public abstract class SerializedExecutor extends Object implements Executor
Serializes execution of multiple submissions to a single target, while still using a thread pool to execute those submissions. Provides an implicit queueing capability for a single target that requires any commands that execute against it to be serialized.
  • Constructor Details

    • SerializedExecutor

      public SerializedExecutor(String name, Executor underlyingExecutor)
      Constructor.
      Parameters:
      underlyingExecutor - underlying executor to use to execute commands submitted to this SerializedExecutor
  • Method Details

    • runException

      protected abstract void runException(Runnable command, Throwable t)
      An exception occurred in the last command executed; this reports that to the subclass of SerializedExecutor.

      The default implementation of this method throws an exception, which is considered an error (see below). Implementors have two alternatives: Arrange not to throw from your commands' run(), or if they do, provide an override of this method that handles any exception that is thrown.

      It is an error for this to throw an exception, and doing so will terminate the thread with an IllegalStateException. Derivers must handle any reported exceptions in other ways.

      Parameters:
      command - the command that caused the exception
      t - the exception
    • execute

      public void execute(Runnable command)
      Specified by:
      execute in interface Executor