use of io.crate.data.RowConsumer in project crate by crate.
the class DistributingConsumerFactoryTest method testCreateDownstreamMultipleNode.
@Test
public void testCreateDownstreamMultipleNode() throws Exception {
RowConsumer downstream = createDownstream(Set.of("downstream_node1", "downstream_node2"));
assertThat(((DistributingConsumer) downstream).multiBucketBuilder, instanceOf(ModuloBucketBuilder.class));
}
use of io.crate.data.RowConsumer in project crate by crate.
the class DistributingConsumerFactoryTest method testCreateDownstreamOneNode.
@Test
public void testCreateDownstreamOneNode() throws Exception {
RowConsumer downstream = createDownstream(Set.of("downstream_node"));
assertThat(downstream, instanceOf(DistributingConsumer.class));
assertThat(((DistributingConsumer) downstream).multiBucketBuilder, instanceOf(BroadcastingBucketBuilder.class));
}
use of io.crate.data.RowConsumer in project crate by crate.
the class ProjectingRowConsumerTest method testConsumerRequiresScrollAndProjectorsSupportScrolling.
@Test
public void testConsumerRequiresScrollAndProjectorsSupportScrolling() {
GroupProjection groupProjection = new GroupProjection(new ArrayList<>(), new ArrayList<>(), AggregateMode.ITER_FINAL, RowGranularity.SHARD);
RowConsumer delegateConsumerRequiresScroll = new DummyRowConsumer(true);
RowConsumer projectingConsumer = ProjectingRowConsumer.create(delegateConsumerRequiresScroll, Collections.singletonList(groupProjection), UUID.randomUUID(), txnCtx, RamAccounting.NO_ACCOUNTING, memoryManager, projectorFactory);
assertThat(projectingConsumer.requiresScroll(), is(false));
}
use of io.crate.data.RowConsumer 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);
}
}
use of io.crate.data.RowConsumer in project crate by crate.
the class CreateAnalyzerPlan method executeOrFail.
@Override
public void executeOrFail(DependencyCarrier dependencies, PlannerContext plannerContext, RowConsumer consumer, Row params, SubQueryResults subQueryResults) {
ClusterUpdateSettingsRequest request = createRequest(createAnalyzer, plannerContext.transactionContext(), dependencies.nodeContext(), params, subQueryResults, dependencies.fulltextAnalyzerResolver());
dependencies.transportActionProvider().transportClusterUpdateSettingsAction().execute(request, new OneRowActionListener<>(consumer, r -> new Row1(1L)));
}
Aggregations