Class ThreadPoolExecutorBase

  • All Implemented Interfaces:
    java.util.concurrent.Executor, java.util.concurrent.ExecutorService, ResizableThreadPool
    Direct Known Subclasses:
    ThreadPoolExecutorPlus

    public class ThreadPoolExecutorBase
    extends java.util.concurrent.ThreadPoolExecutor
    implements ResizableThreadPool
    This class incorporates some Executor best practices for Cassandra. Most of the executors in the system should use or extend ThreadPoolExecutorPlus, or in rare exceptions this class. This class provides some very basic improvements:
  • We are configured by ThreadPoolExecutorBuilder
  • Tasks rejected due to overflow of the queue block the submitting thread rather than throwing RejectedExecutionException
  • RunnableFuture rejected due to executor shutdown will be cancelled
  • RunnableFuture removed by shutdownNow() will be cancelled We also provide a shutdown hook for JMX registration cleanup.