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);
}
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());
}
Aggregations