Class ExecutorSelector

java.lang.Object
org.elasticsearch.indices.ExecutorSelector

public class ExecutorSelector extends Object
Some operations need to use different executors for different index patterns. Specifically, some operations on system indices are considered critical and should use the "system_critical_read" or "system_critical_write" thread pools rather than the "system_read" or "system_write" thread pools.
  • Method Details

    • executorForGet

      public String executorForGet(String indexName)
      The "get" executor should be used when retrieving documents by ID.
      Parameters:
      indexName - Name of the index
      Returns:
      Name of the executor to use for a get operation.
    • executorForSearch

      public String executorForSearch(String indexName)
      The "search" executor should be used for search or aggregation operations.
      Parameters:
      indexName - Name of the index
      Returns:
      Name of the executor to use for a search operation.
    • executorForWrite

      public String executorForWrite(String indexName)
      The "write" executor should be used for operations that write new documents or update existing ones.
      Parameters:
      indexName - Name of the index
      Returns:
      Name of the executor to use for a search operation.
    • getWriteExecutorForShard

      public static String getWriteExecutorForShard(ExecutorSelector executorSelector, IndexShard shard)
      This is a convenience method for the case when we need to find an executor for a shard. Note that it can be passed to methods as a BiFunction.
      Parameters:
      executorSelector - An executor selector service.
      shard - A shard for which we need to find an executor.
      Returns:
      Name of the executor that should be used for write operations on this shard.