Class ThreadPool.Names

java.lang.Object
org.elasticsearch.threadpool.ThreadPool.Names
Enclosing class:
ThreadPool

public static class ThreadPool.Names extends Object
List of names that identify Java thread pools that are created in ThreadPool(). The pools themselves are constructed and configured using DefaultBuiltInExecutorBuilders.
  • Field Details

    • GENERIC

      public static final String GENERIC
      A thread pool with a very high (but finite) maximum size. Use only after careful consideration.

      This pool may be used for one-off CPU-bound activities, but its maximum size is so high that it doesn't really work well to do a lot of CPU-bound work in parallel here: submitting more CPU-bound tasks than we have CPUs to run them will burn a lot of CPU just context-switching in order to try and make fair progress on all the threads at once. Better to submit fewer tasks and wait for them to complete before submitting more, for instance using ThrottledTaskRunner and friends.

      Likewise you can do IO on this pool, but using it for lots of concurrent IO is likely harmful in clusters with poor concurrent IO performance (especially if using spinning disks).

      Blocking on a future on this pool risks deadlock if there's a chance that the completion of the future depends on work being done on this pool. Unfortunately that's pretty likely in most cases because of how often this pool is used; it's really rare to hit such a deadlock because of the high limit on the pool size, but when it happens it is extremely harmful to the node. For more information, see e.g. UnsafePlainActionFuture.

      This pool is for instance used for recovery-related work, which is a mix of CPU-bound and IO-bound work and does not block on futures. The recovery subsystem bounds its own concurrency, and therefore the amount of recovery work done on the #GENERIC pool, via cluster.routing.allocation.node_concurrent_recoveries and related settings. This pool is a good choice for recovery work because the threads used by recovery will be used by other #GENERIC work too rather than mostly sitting idle until cleaned up. Idle threads are surprisingly costly sometimes.

      This pool does not reject any task. Tasks you submit to this executor after the pool starts to shut down may simply never run.

      See Also:
    • CLUSTER_COORDINATION

      public static final String CLUSTER_COORDINATION
      A thread pool solely for the use of the cluster coordination subsystem that relates to cluster state updates, master elections, cluster membership and so on.

      This pool defaults to a single thread to avoid contention on Coordinator#mutex.

      See Also:
    • GET

      public static final String GET
      See Also:
    • ANALYZE

      public static final String ANALYZE
      See Also:
    • WRITE

      public static final String WRITE
      See Also:
    • SEARCH_COORDINATION

      public static final String SEARCH_COORDINATION
      See Also:
    • AUTO_COMPLETE

      public static final String AUTO_COMPLETE
      See Also:
    • MANAGEMENT

      public static final String MANAGEMENT
      A thread pool for running tasks related to cluster management, including collecting and exposing stats in APIs and certain other internal tasks.

      This pool is deliberately small in order to throttle the rate at which such tasks are executed and avoid diverting resources away from production-critical work such as indexing and search. You may run long-running (CPU-bound or IO-bound) tasks on this pool, but if the work relates to a REST API call then it must be cancellable in order to prevent an overexcited client from blocking or delaying other management work.

      Note that a cluster with overloaded MANAGEMENT pools will typically struggle to respond to stats APIs and may be hard to troubleshoot.

      See Also:
    • FLUSH

      public static final String FLUSH
      See Also:
    • REFRESH

      public static final String REFRESH
      See Also:
    • WARMER

      public static final String WARMER
      See Also:
    • SNAPSHOT

      public static final String SNAPSHOT
      See Also:
    • SNAPSHOT_META

      public static final String SNAPSHOT_META
      See Also:
    • MERGE

      public static final String MERGE
      See Also:
    • FORCE_MERGE

      public static final String FORCE_MERGE
      See Also:
    • FETCH_SHARD_STARTED

      public static final String FETCH_SHARD_STARTED
      See Also:
    • FETCH_SHARD_STORE

      public static final String FETCH_SHARD_STORE
      See Also:
    • SYSTEM_READ

      public static final String SYSTEM_READ
      See Also:
    • SYSTEM_WRITE

      public static final String SYSTEM_WRITE
      See Also:
    • SYSTEM_CRITICAL_READ

      public static final String SYSTEM_CRITICAL_READ
      See Also:
    • SYSTEM_CRITICAL_WRITE

      public static final String SYSTEM_CRITICAL_WRITE
      See Also:
  • Constructor Details

    • Names

      public Names()