Class SingleThreadExecutor

java.lang.Object
java.util.concurrent.AbstractExecutorService
org.apache.bookkeeper.common.util.SingleThreadExecutor
All Implemented Interfaces:
Runnable, Executor, ExecutorService

public class SingleThreadExecutor extends AbstractExecutorService implements ExecutorService, Runnable
Implements a single thread executor that drains the queue in batches to minimize contention between threads.

Tasks are executed in a safe manner: if there are exceptions they are logged and the executor will proceed with the next tasks.

  • Constructor Details

    • SingleThreadExecutor

      public SingleThreadExecutor(ThreadFactory tf)
    • SingleThreadExecutor

      public SingleThreadExecutor(ThreadFactory tf, int maxQueueCapacity, boolean rejectExecution)
  • Method Details