Search in sources :

Example 26 with JobConfig

use of alluxio.job.JobConfig 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

JobConfig (alluxio.job.JobConfig)26 Test (org.junit.Test)17 SleepJobConfig (alluxio.job.SleepJobConfig)10 TestPlanConfig (alluxio.job.TestPlanConfig)9 Serializable (java.io.Serializable)7 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)7 JobServerContext (alluxio.job.JobServerContext)5 CompositeConfig (alluxio.job.workflow.composite.CompositeConfig)5 CommandManager (alluxio.master.job.command.CommandManager)5 WorkerInfo (alluxio.wire.WorkerInfo)5 ArrayList (java.util.ArrayList)5 JobDoesNotExistException (alluxio.exception.JobDoesNotExistException)4 BatchedJobConfig (alluxio.job.plan.BatchedJobConfig)4 PlanInfo (alluxio.job.plan.meta.PlanInfo)4 ResourceExhaustedException (alluxio.exception.status.ResourceExhaustedException)3 RunTaskCommand (alluxio.grpc.RunTaskCommand)3 RunTaskContext (alluxio.job.RunTaskContext)3 CompactConfig (alluxio.job.plan.transform.CompactConfig)3 WorkflowInfo (alluxio.job.wire.WorkflowInfo)3 PlanCoordinator (alluxio.master.job.plan.PlanCoordinator)3