Search in sources :

Example 6 with NodeOperationTree

use of io.crate.execution.dsl.phases.NodeOperationTree in project crate by crate.

the class JobLauncher method execute.

public void execute(RowConsumer consumer, TransactionContext txnCtx) {
    assert nodeOperationTrees.size() == 1 : "must only have 1 NodeOperationTree for non-bulk operations";
    NodeOperationTree nodeOperationTree = nodeOperationTrees.get(0);
    Map<String, Collection<NodeOperation>> operationByServer = NodeOperationGrouper.groupByServer(nodeOperationTree.nodeOperations());
    List<ExecutionPhase> handlerPhases = Collections.singletonList(nodeOperationTree.leaf());
    List<RowConsumer> handlerConsumers = Collections.singletonList(consumer);
    try {
        setupTasks(txnCtx, operationByServer, handlerPhases, handlerConsumers);
    } catch (Throwable throwable) {
        consumer.accept(null, throwable);
    }
}
Also used : NodeOperationTree(io.crate.execution.dsl.phases.NodeOperationTree) Collection(java.util.Collection) ExecutionPhase(io.crate.execution.dsl.phases.ExecutionPhase) CollectingRowConsumer(io.crate.data.CollectingRowConsumer) RowConsumer(io.crate.data.RowConsumer)

Aggregations

NodeOperationTree (io.crate.execution.dsl.phases.NodeOperationTree)6 RowConsumer (io.crate.data.RowConsumer)3 ExecutionPlan (io.crate.planner.ExecutionPlan)3 CollectingRowConsumer (io.crate.data.CollectingRowConsumer)2 ExecutionPhase (io.crate.execution.dsl.phases.ExecutionPhase)2 Collection (java.util.Collection)2 UUID (java.util.UUID)2 BaseResultReceiver (io.crate.action.sql.BaseResultReceiver)1 RowConsumerToResultReceiver (io.crate.action.sql.RowConsumerToResultReceiver)1 Tuple (io.crate.common.collections.Tuple)1 CompletableFutures (io.crate.concurrent.CompletableFutures)1 Row1 (io.crate.data.Row1)1 ExecutionPhases (io.crate.execution.dsl.phases.ExecutionPhases)1 NodeOperation (io.crate.execution.dsl.phases.NodeOperation)1 NodeOperationGrouper (io.crate.execution.dsl.phases.NodeOperationGrouper)1 StreamBucket (io.crate.execution.engine.distribution.StreamBucket)1 DownstreamRXTask (io.crate.execution.jobs.DownstreamRXTask)1 InstrumentedIndexSearcher (io.crate.execution.jobs.InstrumentedIndexSearcher)1 JobSetup (io.crate.execution.jobs.JobSetup)1 PageBucketReceiver (io.crate.execution.jobs.PageBucketReceiver)1