Search in sources :

Example 16 with SleepJobConfig

use of alluxio.job.SleepJobConfig in project alluxio by Alluxio.

the class JobMasterClientRestApiTest method run.

@Test
public void run() throws Exception {
    final long jobId = startJob(new SleepJobConfig(200));
    Assert.assertEquals(1, mJobMaster.list(ListAllPOptions.getDefaultInstance()).size());
    waitForStatus(jobId, Status.COMPLETED);
}
Also used : SleepJobConfig(alluxio.job.SleepJobConfig) Test(org.junit.Test)

Example 17 with SleepJobConfig

use of alluxio.job.SleepJobConfig in project alluxio by Alluxio.

the class JobMasterClientRestApiTest method getStatus.

@Test
public void getStatus() throws Exception {
    JobConfig config = new SleepJobConfig(Constants.SECOND_MS);
    final long jobId = startJob(config);
    Map<String, String> params = Maps.newHashMap();
    params.put("jobId", Long.toString(jobId));
    TestCaseOptions options = TestCaseOptions.defaults().setPrettyPrint(true);
    String result = new TestCase(mHostname, mPort, getEndpoint(ServiceConstants.GET_STATUS), params, HttpMethod.GET, null, options).call();
    TypeReference<HashMap<String, Object>> typeRef = new TypeReference<HashMap<String, Object>>() {
    };
    HashMap<String, Object> jobInfo = new ObjectMapper().readValue(result, typeRef);
    Assert.assertEquals(jobId, jobInfo.get("id"));
    Assert.assertEquals(1, ((Collection) jobInfo.get("children")).size());
}
Also used : HashMap(java.util.HashMap) SleepJobConfig(alluxio.job.SleepJobConfig) JobConfig(alluxio.job.JobConfig) SleepJobConfig(alluxio.job.SleepJobConfig) TypeReference(com.fasterxml.jackson.core.type.TypeReference) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Test(org.junit.Test)

Aggregations

SleepJobConfig (alluxio.job.SleepJobConfig)17 Test (org.junit.Test)16 BaseIntegrationTest (alluxio.testutils.BaseIntegrationTest)6 JobInfo (alluxio.job.wire.JobInfo)5 JobConfig (alluxio.job.JobConfig)4 JobIntegrationTest (alluxio.job.JobIntegrationTest)3 JobServerContext (alluxio.job.JobServerContext)2 CompositeConfig (alluxio.job.workflow.composite.CompositeConfig)2 CommandManager (alluxio.master.job.command.CommandManager)2 WorkerInfo (alluxio.wire.WorkerInfo)2 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)2 ResourceExhaustedException (alluxio.exception.status.ResourceExhaustedException)1 RunTaskCommand (alluxio.grpc.RunTaskCommand)1 RunTaskContext (alluxio.job.RunTaskContext)1 TestPlanConfig (alluxio.job.TestPlanConfig)1 PlanConfig (alluxio.job.plan.PlanConfig)1 PlanInfo (alluxio.job.plan.meta.PlanInfo)1 Status (alluxio.job.wire.Status)1 WorkflowInfo (alluxio.job.wire.WorkflowInfo)1 JobMaster (alluxio.master.job.JobMaster)1