Package org.elasticsearch.indices
Class ExecutorSelector
java.lang.Object
org.elasticsearch.indices.ExecutorSelector
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 Summary
Modifier and TypeMethodDescriptionexecutorForGet(String indexName)
The "get" executor should be used when retrieving documents by ID.executorForSearch(String indexName)
The "search" executor should be used for search or aggregation operations.executorForWrite(String indexName)
The "write" executor should be used for operations that write new documents or update existing ones.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.
-
Method Details
-
executorForGet
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
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
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
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 aBiFunction
.- 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.
-