use of io.crate.operation.collect.stats.JobsLogs in project crate by crate.
the class ConnectionContextTest method setUp.
@Before
public void setUp() throws Exception {
JobsLogs jobsLogs = new JobsLogs(() -> true);
sqlOperations = new SQLOperations(e.analyzer, e.planner, () -> mock(Executor.class), jobsLogs, Settings.EMPTY, clusterService) {
@Override
public Session createSession(@Nullable String defaultSchema, Set<Option> options, int defaultLimit) {
Session session = super.createSession(defaultSchema, options, defaultLimit);
sessions.add(session);
return session;
}
};
}
use of io.crate.operation.collect.stats.JobsLogs in project crate by crate.
the class JobExecutionContextTest method testErrorMessageIsIncludedInStatsTableOnFailure.
@Test
public void testErrorMessageIsIncludedInStatsTableOnFailure() throws Exception {
JobsLogs jobsLogs = mock(JobsLogs.class);
JobExecutionContext.Builder builder = new JobExecutionContext.Builder(UUID.randomUUID(), coordinatorNode, Collections.emptyList(), jobsLogs);
ExecutionSubContext executionSubContext = new AbstractExecutionSubContext(0, logger) {
@Override
public String name() {
return "dummy";
}
};
builder.addSubContext(executionSubContext);
builder.build();
executionSubContext.kill(new IllegalStateException("dummy"));
verify(jobsLogs).operationFinished(anyInt(), any(UUID.class), eq("dummy"), anyLong());
}
use of io.crate.operation.collect.stats.JobsLogs in project crate by crate.
the class DecommissioningServiceTest method setUp.
@Before
public void setUp() throws Exception {
NodeSettingsService settingsService = new NodeSettingsService(Settings.EMPTY);
threadPool = mock(ThreadPool.class, Answers.RETURNS_MOCKS.get());
jobsLogs = new JobsLogs(() -> true);
sqlOperations = mock(SQLOperations.class, Answers.RETURNS_MOCKS.get());
decommissioningService = new TestableDecommissioningService(Settings.EMPTY, new NoopClusterService(), jobsLogs, threadPool, settingsService, sqlOperations, mock(TransportClusterHealthAction.class), mock(TransportClusterUpdateSettingsAction.class));
}
use of io.crate.operation.collect.stats.JobsLogs 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);
}
use of io.crate.operation.collect.stats.JobsLogs in project crate by crate.
the class JobContextServiceTest method prepare.
@Before
public void prepare() throws Exception {
JobsLogs jobsLogs = new JobsLogs(() -> true);
jobContextService = new JobContextService(Settings.EMPTY, new NoopClusterService(), jobsLogs);
}
Aggregations