Search in sources :

Example 11 with JobContextLog

use of io.crate.expression.reference.sys.job.JobContextLog in project crate by crate.

the class JobLogIntegrationTest method assertJobLogOnNodesHaveOnlyStatement.

private void assertJobLogOnNodesHaveOnlyStatement(String statement) throws Exception {
    for (JobsLogService jobsLogService : internalCluster().getDataNodeInstances(JobsLogService.class)) {
        assertBusy(() -> {
            assertThat(jobsLogService.jobsLogSize(), is(1));
            JobsLogs jobsLogs = jobsLogService.get();
            Iterator<JobContextLog> iterator = jobsLogs.jobsLog().iterator();
            if (iterator.hasNext()) {
                assertThat(iterator.next().statement(), is(statement));
            }
        });
    }
}
Also used : JobContextLog(io.crate.expression.reference.sys.job.JobContextLog) JobsLogs(io.crate.execution.engine.collect.stats.JobsLogs) JobsLogService(io.crate.execution.engine.collect.stats.JobsLogService)

Aggregations

JobContextLog (io.crate.expression.reference.sys.job.JobContextLog)11 Test (org.junit.Test)8 CrateDummyClusterServiceUnitTest (io.crate.test.integration.CrateDummyClusterServiceUnitTest)6 JobContext (io.crate.expression.reference.sys.job.JobContext)5 ClusterSettings (org.elasticsearch.common.settings.ClusterSettings)4 Settings (org.elasticsearch.common.settings.Settings)4 BlockingEvictingQueue (io.crate.common.collections.BlockingEvictingQueue)3 Classification (io.crate.planner.operators.StatementClassifier.Classification)3 JobsLogService (io.crate.execution.engine.collect.stats.JobsLogService)2 JobsLogs (io.crate.execution.engine.collect.stats.JobsLogs)2 OperationContextLog (io.crate.expression.reference.sys.operation.OperationContextLog)2 User (io.crate.user.User)2 SQLOperations (io.crate.action.sql.SQLOperations)1 Session (io.crate.action.sql.Session)1 OperationContext (io.crate.expression.reference.sys.operation.OperationContext)1 MetricsView (io.crate.metadata.sys.MetricsView)1 StatementClassifier (io.crate.planner.operators.StatementClassifier)1 UseJdbc (io.crate.testing.UseJdbc)1 ConcurrentLinkedDeque (java.util.concurrent.ConcurrentLinkedDeque)1 ConcurrentLinkedQueue (java.util.concurrent.ConcurrentLinkedQueue)1