Class ComputeService

java.lang.Object
org.elasticsearch.xpack.esql.plugin.ComputeService

public class ComputeService extends Object
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#startComputeOnDataNodes in 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.