use of io.crate.execution.dsl.phases.ExecutionPhase in project crate by crate.
the class NodeOperationCtxTest method testFindLeafWithNodeOperationsThatHaveNoLeaf.
@Test
public void testFindLeafWithNodeOperationsThatHaveNoLeaf() {
ExecutionPhase p1 = newPhase(0, "n1");
NodeOperationCtx opCtx = new NodeOperationCtx("n1", singletonList(NodeOperation.withDownstream(p1, p1, (byte) 0)));
assertThat(stream(opCtx.findLeafs().spliterator(), false).count(), is(0L));
}
use of io.crate.execution.dsl.phases.ExecutionPhase 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);
}
}
Aggregations