Class ExecutorFactoryCassandraSEPImpl

  • All Implemented Interfaces:
    ExecutorFactory

    public class ExecutorFactoryCassandraSEPImpl
    extends java.lang.Object
    implements ExecutorFactory
    This ExecutorFactory returns ExecutorService instances that are implemented with Cassandra's high performance, low-context-switching SharedExecutorPool.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.apache.cassandra.concurrent.JMXEnabledSharedExecutorPool SHARED
      Create a shared executor pool for all of the threads used in this class TODO: Make this into a map of separate pools per daemon?
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.concurrent.ExecutorService newExecutor​(int threads, int queueSize, java.lang.String daemonName, java.lang.String executorName)
      Construct a new ExecutorService with a specified queue size for the backlog of tasks.
      java.util.concurrent.ExecutorService newExecutor​(int threads, java.lang.String daemonName, java.lang.String executorName)
      Construct a new ExecutorService with an unbounded queue size ({@link Integer#MAX_VALUE). For CPU-intensive tasks, it is a good idea to use the value of {@link Runtime#availableProcessors()} (or a reasonable multiple of it based on the tasks) for the threads parameter to ensure that the CPU is fully utilized.
      java.util.concurrent.ExecutorService newExecutor​(java.lang.String daemonName, java.lang.String executorName)
      Construct a new ExecutorService with an unbounded queue size and a thread pool size equal to the value of Runtime.availableProcessors() so that one thread per core is started.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • SHARED

        public static final org.apache.cassandra.concurrent.JMXEnabledSharedExecutorPool SHARED
        Create a shared executor pool for all of the threads used in this class TODO: Make this into a map of separate pools per daemon?
    • Constructor Detail

      • ExecutorFactoryCassandraSEPImpl

        public ExecutorFactoryCassandraSEPImpl()
    • Method Detail

      • newExecutor

        public java.util.concurrent.ExecutorService newExecutor​(java.lang.String daemonName,
                                                                java.lang.String executorName)
        Description copied from interface: ExecutorFactory
        Construct a new ExecutorService with an unbounded queue size and a thread pool size equal to the value of Runtime.availableProcessors() so that one thread per core is started.
        Specified by:
        newExecutor in interface ExecutorFactory
        Returns:
      • newExecutor

        public java.util.concurrent.ExecutorService newExecutor​(int threads,
                                                                java.lang.String daemonName,
                                                                java.lang.String executorName)
        Description copied from interface: ExecutorFactory
        Construct a new ExecutorService with an unbounded queue size ({@link Integer#MAX_VALUE). For CPU-intensive tasks, it is a good idea to use the value of {@link Runtime#availableProcessors()} (or a reasonable multiple of it based on the tasks) for the threads parameter to ensure that the CPU is fully utilized.
        Specified by:
        newExecutor in interface ExecutorFactory
        Returns:
        An ExecutorService pool
      • newExecutor

        public java.util.concurrent.ExecutorService newExecutor​(int threads,
                                                                int queueSize,
                                                                java.lang.String daemonName,
                                                                java.lang.String executorName)
        Description copied from interface: ExecutorFactory
        Construct a new ExecutorService with a specified queue size for the backlog of tasks. When the queue is full, the pool may block, discard the incoming task, or throw an exception. This behavior is dependent on the implementation of the ExecutorService. For CPU-intensive tasks, it is a good idea to use the value of Runtime.availableProcessors() (or a reasonable multiple of it based on the tasks) for the threads parameter to ensure that the CPU is fully utilized.
        Specified by:
        newExecutor in interface ExecutorFactory
        Returns:
        An ExecutorService pool