Search in sources :

Example 1 with NoopPlanConfig

use of alluxio.job.plan.NoopPlanConfig in project alluxio by Alluxio.

the class StressJobServiceBench method runNoop.

private void runNoop() throws IOException, InterruptedException, TimeoutException {
    long jobId = mJobMasterClient.run(new NoopPlanConfig());
    // TODO(jianjian): refactor JobTestUtils
    ImmutableSet<Status> statuses = ImmutableSet.of(Status.COMPLETED, Status.CANCELED, Status.FAILED);
    final AtomicReference<JobInfo> singleton = new AtomicReference<>();
    CommonUtils.waitFor(String.format("job %d to be one of status %s", jobId, Arrays.toString(statuses.toArray())), () -> {
        JobInfo info;
        try {
            info = mJobMasterClient.getJobStatus(jobId);
            if (statuses.contains(info.getStatus())) {
                singleton.set(info);
            }
            return statuses.contains(info.getStatus());
        } catch (IOException e) {
            throw Throwables.propagate(e);
        }
    }, WaitForOptions.defaults().setTimeoutMs(30 * Constants.SECOND_MS));
    JobInfo jobInfo = singleton.get();
    if (jobInfo.getStatus().equals(Status.FAILED)) {
        throw new IOException(jobInfo.getErrorMessage());
    }
}
Also used : Status(alluxio.job.wire.Status) URIStatus(alluxio.client.file.URIStatus) NoopPlanConfig(alluxio.job.plan.NoopPlanConfig) JobInfo(alluxio.job.wire.JobInfo) AtomicReference(java.util.concurrent.atomic.AtomicReference) IOException(java.io.IOException)

Example 2 with NoopPlanConfig

use of alluxio.job.plan.NoopPlanConfig in project alluxio by Alluxio.

the class CompositeIntegrationTest method testCompositeDoNothing.

@Test
public void testCompositeDoNothing() throws Exception {
    NoopPlanConfig jobConfig = new NoopPlanConfig();
    long jobId = mJobMaster.run(new CompositeConfig(Lists.newArrayList(jobConfig), true));
    waitForJobToFinish(jobId);
}
Also used : NoopPlanConfig(alluxio.job.plan.NoopPlanConfig) JobIntegrationTest(alluxio.job.JobIntegrationTest) Test(org.junit.Test)

Aggregations

NoopPlanConfig (alluxio.job.plan.NoopPlanConfig)2 URIStatus (alluxio.client.file.URIStatus)1 JobIntegrationTest (alluxio.job.JobIntegrationTest)1 JobInfo (alluxio.job.wire.JobInfo)1 Status (alluxio.job.wire.Status)1 IOException (java.io.IOException)1 AtomicReference (java.util.concurrent.atomic.AtomicReference)1 Test (org.junit.Test)1