Package org.apache.drill.common
Class SerializedExecutor
java.lang.Object
org.apache.drill.common.SerializedExecutor
- All Implemented Interfaces:
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
protected abstract void
runException
(Runnable command, Throwable t) An exception occurred in the last command executed; this reports that to the subclass of SerializedExecutor.
-
Constructor Details
-
SerializedExecutor
Constructor.- Parameters:
underlyingExecutor
- underlying executor to use to execute commands submitted to this SerializedExecutor
-
-
Method Details
-
runException
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 exceptiont
- the exception
-
execute
-