Search in sources :

Example 1 with TransportJobAction

use of io.crate.action.job.TransportJobAction in project crate by crate.

the class RemoteCollectorTest method setUp.

@Before
public void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);
    UUID jobId = UUID.randomUUID();
    RoutedCollectPhase collectPhase = new RoutedCollectPhase(jobId, 0, "remoteCollect", new Routing(ImmutableMap.<String, Map<String, List<Integer>>>of("remoteNode", ImmutableMap.of("dummyTable", Collections.singletonList(1)))), RowGranularity.DOC, Collections.<Symbol>singletonList(createReference("name", DataTypes.STRING)), Collections.<Projection>emptyList(), WhereClause.MATCH_ALL, DistributionInfo.DEFAULT_BROADCAST);
    transportJobAction = mock(TransportJobAction.class);
    transportKillJobsNodeAction = mock(TransportKillJobsNodeAction.class);
    consumer = new TestingBatchConsumer();
    JobsLogs jobsLogs = new JobsLogs(() -> true);
    JobContextService jobContextService = new JobContextService(Settings.EMPTY, new NoopClusterService(), jobsLogs);
    remoteCollector = new RemoteCollector(jobId, "localNode", "remoteNode", transportJobAction, transportKillJobsNodeAction, jobContextService, mock(RamAccountingContext.class), consumer, collectPhase);
}
Also used : TransportJobAction(io.crate.action.job.TransportJobAction) TransportKillJobsNodeAction(io.crate.executor.transport.kill.TransportKillJobsNodeAction) Routing(io.crate.metadata.Routing) TestingBatchConsumer(io.crate.testing.TestingBatchConsumer) JobsLogs(io.crate.operation.collect.stats.JobsLogs) UUID(java.util.UUID) Map(java.util.Map) ImmutableMap(com.google.common.collect.ImmutableMap) NoopClusterService(org.elasticsearch.test.cluster.NoopClusterService) RoutedCollectPhase(io.crate.planner.node.dql.RoutedCollectPhase) JobContextService(io.crate.jobs.JobContextService) Before(org.junit.Before)

Aggregations

ImmutableMap (com.google.common.collect.ImmutableMap)1 TransportJobAction (io.crate.action.job.TransportJobAction)1 TransportKillJobsNodeAction (io.crate.executor.transport.kill.TransportKillJobsNodeAction)1 JobContextService (io.crate.jobs.JobContextService)1 Routing (io.crate.metadata.Routing)1 JobsLogs (io.crate.operation.collect.stats.JobsLogs)1 RoutedCollectPhase (io.crate.planner.node.dql.RoutedCollectPhase)1 TestingBatchConsumer (io.crate.testing.TestingBatchConsumer)1 Map (java.util.Map)1 UUID (java.util.UUID)1 NoopClusterService (org.elasticsearch.test.cluster.NoopClusterService)1 Before (org.junit.Before)1