Class ComputeService
java.lang.Object
org.elasticsearch.xpack.esql.plugin.ComputeService
Once query is parsed and validated it is scheduled for execution by
org.elasticsearch.xpack.esql.plugin.ComputeService#execute
This method is responsible for splitting physical plan into coordinator and data node plans.
Coordinator plan is immediately executed locally (using org.elasticsearch.xpack.esql.plugin.ComputeService#runCompute)
and is prepared to collect and merge pages from data nodes into the final query result.
Data node plan is passed to org.elasticsearch.xpack.esql.plugin.DataNodeComputeHandler#startComputeOnDataNodes
that is responsible for
-
Determining list of nodes that contain shards referenced by the query with
org.elasticsearch.xpack.esql.plugin.DataNodeRequestSender#searchShards -
Each node in the list processed in
org.elasticsearch.xpack.esql.plugin.DataNodeComputeHandler#startComputeOnDataNodesin order to- Open ExchangeSink on the target data node and link it with local ExchangeSource for the query using `internal:data/read/esql/open_exchange` transport request.
- Start data node plan execution on the target data node using `indices:data/read/esql/data` transport request
- While coordinator plan executor is running it will read data from ExchangeSource that will poll pages from linked ExchangeSink on target data nodes or notify them that data set is already completed (for example when running FROM * | LIMIT 10 type of query) or query is canceled using `internal:data/read/esql/exchange` transport requests.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionComputeService(TransportActionServices transportActionServices, EnrichLookupService enrichLookupService, LookupFromIndexService lookupFromIndexService, ThreadPool threadPool, BigArrays bigArrays, BlockFactory blockFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(String sessionId, CancellableTask rootTask, EsqlFlags flags, PhysicalPlan physicalPlan, Configuration configuration, FoldContext foldContext, EsqlExecutionInfo execInfo, ActionListener<Result> listener) voidexecutePlan(String sessionId, CancellableTask rootTask, EsqlFlags flags, PhysicalPlan physicalPlan, Configuration configuration, FoldContext foldContext, EsqlExecutionInfo execInfo, String profileQualifier, ActionListener<Result> listener, Supplier<ExchangeSink> exchangeSinkSupplier)
-
Field Details
-
DATA_ACTION_NAME
- See Also:
-
CLUSTER_ACTION_NAME
- See Also:
-
-
Constructor Details
-
ComputeService
public ComputeService(TransportActionServices transportActionServices, EnrichLookupService enrichLookupService, LookupFromIndexService lookupFromIndexService, ThreadPool threadPool, BigArrays bigArrays, BlockFactory blockFactory)
-
-
Method Details
-
execute
public void execute(String sessionId, CancellableTask rootTask, EsqlFlags flags, PhysicalPlan physicalPlan, Configuration configuration, FoldContext foldContext, EsqlExecutionInfo execInfo, ActionListener<Result> listener) -
executePlan
public void executePlan(String sessionId, CancellableTask rootTask, EsqlFlags flags, PhysicalPlan physicalPlan, Configuration configuration, FoldContext foldContext, EsqlExecutionInfo execInfo, String profileQualifier, ActionListener<Result> listener, Supplier<ExchangeSink> exchangeSinkSupplier) -
createFlags
-