Class EsExecutors

org.elasticsearch.common.util.concurrent.EsExecutors

public class EsExecutors extends
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static
    that executes submitted tasks on the current thread.
    static >
    Setting to manually control the number of allocated processors.
    static >
    Setting to manually set the number of available processors.
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    Returns the number of allocated processors.
    static
     namePrefix)
     
    static
     nodeName,  namePrefix)
     
    static
    daemonThreadFactory​(Settings settings,  namePrefix)
     
     name, int size, int initialQueueCapacity, int minQueueSize, int maxQueueSize, int frameSize, org.elasticsearch.core.TimeValue targetedResponseTime,  threadFactory, ThreadContext contextHolder)
    Return a new executor that will automatically adjust the queue size based on queue throughput.
     name, int size, int queueCapacity,  threadFactory, ThreadContext contextHolder)
     
     name, int min, int max, long keepAliveTime,  unit,  threadFactory, ThreadContext contextHolder)
     
     name,  threadFactory, ThreadContext contextHolder,  timer)
     
    static
     runnable)
    Checks if the runnable arose from asynchronous submission of a task to an executor.
    static
     nodeName,  namePrefix)
     
    static
    threadName​(Settings settings,  namePrefix)
     

    Methods inherited from class java.lang.

    , , , , , , , , , ,
  • Field Details

    • PROCESSORS_SETTING

      public static final > PROCESSORS_SETTING
      Setting to manually set the number of available processors. This setting is used to adjust thread pool sizes per node.
    • NODE_PROCESSORS_SETTING

      public static final > NODE_PROCESSORS_SETTING
      Setting to manually control the number of allocated processors. This setting is used to adjust thread pool sizes per node. The default value is but should be manually controlled if not all processors on the machine are available to Elasticsearch (e.g., because of CPU limits).
    • DIRECT_EXECUTOR_SERVICE

      public static final  DIRECT_EXECUTOR_SERVICE
      that executes submitted tasks on the current thread. This executor service does not support being shutdown.
  • Method Details

    • allocatedProcessors

      public static int allocatedProcessors(Settings settings)
      Returns the number of allocated processors. Defaults to but can be overridden by passing a Settings instance with the key node.processors set to the desired value.
      Parameters:
      settings - a Settings instance from which to derive the allocated processors
      Returns:
      the number of allocated processors
    • newSinglePrioritizing

      public static  name,  threadFactory, ThreadContext contextHolder,  timer)
    • newScaling

      public static  name, int min, int max, long keepAliveTime,  unit,  threadFactory, ThreadContext contextHolder)
    • newFixed

      public static  name, int size, int queueCapacity,  threadFactory, ThreadContext contextHolder)
    • newAutoQueueFixed

      public static  name, int size, int initialQueueCapacity, int minQueueSize, int maxQueueSize, int frameSize, org.elasticsearch.core.TimeValue targetedResponseTime,  threadFactory, ThreadContext contextHolder)
      Return a new executor that will automatically adjust the queue size based on queue throughput.
      Parameters:
      size - number of fixed threads to use for executing tasks
      initialQueueCapacity - initial size of the executor queue
      minQueueSize - minimum queue size that the queue can be adjusted to
      maxQueueSize - maximum queue size that the queue can be adjusted to
      frameSize - number of tasks during which stats are collected before adjusting queue size
    • rethrowErrors

      public static  rethrowErrors( runnable)
      Checks if the runnable arose from asynchronous submission of a task to an executor. If an uncaught exception was thrown during the execution of this task, we need to inspect this runnable and see if it is an error that should be propagated to the uncaught exception handler.
      Parameters:
      runnable - the runnable to inspect, should be a RunnableFuture
      Returns:
      non fatal exception or null if no exception.
    • threadName

      public static  threadName(Settings settings,  namePrefix)
    • threadName

      public static  threadName( nodeName,  namePrefix)
    • daemonThreadFactory

      public static  daemonThreadFactory(Settings settings,  namePrefix)
    • daemonThreadFactory

      public static  daemonThreadFactory( nodeName,  namePrefix)
    • daemonThreadFactory

      public static  daemonThreadFactory( namePrefix)