org.apache.kylin.rest.request.JobBuildRequest Java Examples

The following examples show how to use org.apache.kylin.rest.request.JobBuildRequest. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JobControllerTest.java    From Kylin with Apache License 2.0 6 votes vote down vote up
@Test
public void testBasics() throws IOException, PersistentException {
    CubeDesc cubeDesc = cubeDescManager.getCubeDesc("test_kylin_cube_with_slr_left_join_desc");
    CubeInstance cube = cubeManager.createCube(CUBE_NAME, "DEFAULT", cubeDesc, "test");
    assertNotNull(cube);

    JobListRequest jobRequest = new JobListRequest();
    Assert.assertNotNull(jobSchedulerController.list(jobRequest));

    JobBuildRequest jobBuildRequest = new JobBuildRequest();
    jobBuildRequest.setBuildType("BUILD");
    jobBuildRequest.setStartTime(0L);
    jobBuildRequest.setEndTime(new Date().getTime());
    JobInstance job = cubeController.rebuild(CUBE_NAME, jobBuildRequest);

    Assert.assertNotNull(jobSchedulerController.get(job.getId()));
    executableDAO.deleteJob(job.getId());
    if (cubeManager.getCube(CUBE_NAME) != null) {
        cubeManager.dropCube(CUBE_NAME, false);
    }

    // jobSchedulerController.cancel(job.getId());
}
 
Example #2
Source File: JobControllerTest.java    From kylin-on-parquet-v2 with Apache License 2.0 5 votes vote down vote up
@Test
public void testBasics() throws IOException, PersistentException {
    CubeDesc cubeDesc = cubeDescManager.getCubeDesc("test_kylin_cube_with_slr_left_join_desc");
    CubeInstance cube = cubeManager.createCube(CUBE_NAME, "DEFAULT", cubeDesc, "test");
    Assert.assertNotNull(cube);

    JobListRequest jobRequest = new JobListRequest();
    jobRequest.setTimeFilter(4);
    Assert.assertNotNull(jobSchedulerController.list(jobRequest));

    jobRequest.setJobSearchMode("ALL");
    Assert.assertNotNull(jobSchedulerController.list(jobRequest));

    jobRequest.setJobSearchMode("");
    Assert.assertNotNull(jobSchedulerController.list(jobRequest));

    jobRequest.setJobSearchMode("wrong-input");
    Assert.assertNotNull(jobSchedulerController.list(jobRequest));

    JobBuildRequest jobBuildRequest = new JobBuildRequest();
    jobBuildRequest.setBuildType("BUILD");
    jobBuildRequest.setStartTime(0L);
    jobBuildRequest.setEndTime(new Date().getTime());
    JobInstance job = cubeController.rebuild(CUBE_NAME, jobBuildRequest);

    Assert.assertNotNull(jobSchedulerController.get(job.getId()));

    job = jobSchedulerController.cancel(job.getId());
    Assert.assertEquals(JobStatusEnum.DISCARDED, job.getStatus());

    executableDAO.deleteJob(job.getId());
    if (cubeManager.getCube(CUBE_NAME) != null) {
        cubeManager.dropCube(CUBE_NAME, false);
    }
}
 
Example #3
Source File: CubeController.java    From kylin-on-parquet-v2 with Apache License 2.0 5 votes vote down vote up
/**
 * Build/Rebuild a cube segment
 */
@RequestMapping(value = "/{cubeName}/rebuild", method = { RequestMethod.PUT }, produces = { "application/json" })
@ResponseBody
public JobInstance rebuild(@PathVariable String cubeName, @RequestBody JobBuildRequest req) {
    return buildInternal(cubeName, new TSRange(req.getStartTime(), req.getEndTime()), null, null, null,
            req.getBuildType(), req.isForce() || req.isForceMergeEmptySegment(), req.getPriorityOffset());
}
 
Example #4
Source File: JobControllerTest.java    From kylin with Apache License 2.0 5 votes vote down vote up
@Test
public void testBasics() throws IOException, PersistentException {
    CubeDesc cubeDesc = cubeDescManager.getCubeDesc("test_kylin_cube_with_slr_left_join_desc");
    CubeInstance cube = cubeManager.createCube(CUBE_NAME, "DEFAULT", cubeDesc, "test");
    Assert.assertNotNull(cube);

    JobListRequest jobRequest = new JobListRequest();
    jobRequest.setTimeFilter(4);
    Assert.assertNotNull(jobSchedulerController.list(jobRequest));

    jobRequest.setJobSearchMode("ALL");
    Assert.assertNotNull(jobSchedulerController.list(jobRequest));

    jobRequest.setJobSearchMode("");
    Assert.assertNotNull(jobSchedulerController.list(jobRequest));

    jobRequest.setJobSearchMode("wrong-input");
    Assert.assertNotNull(jobSchedulerController.list(jobRequest));

    JobBuildRequest jobBuildRequest = new JobBuildRequest();
    jobBuildRequest.setBuildType("BUILD");
    jobBuildRequest.setStartTime(0L);
    jobBuildRequest.setEndTime(new Date().getTime());
    JobInstance job = cubeController.rebuild(CUBE_NAME, jobBuildRequest);

    Assert.assertNotNull(jobSchedulerController.get(job.getId()));

    job = jobSchedulerController.cancel(job.getId());
    Assert.assertEquals(JobStatusEnum.DISCARDED, job.getStatus());

    executableDAO.deleteJob(job.getId());
    if (cubeManager.getCube(CUBE_NAME) != null) {
        cubeManager.dropCube(CUBE_NAME, false);
    }
}
 
Example #5
Source File: CubeController.java    From kylin with Apache License 2.0 5 votes vote down vote up
/**
 * Build/Rebuild a cube segment
 */
@RequestMapping(value = "/{cubeName}/rebuild", method = { RequestMethod.PUT }, produces = { "application/json" })
@ResponseBody
public JobInstance rebuild(@PathVariable String cubeName, @RequestBody JobBuildRequest req) {
    return buildInternal(cubeName, new TSRange(req.getStartTime(), req.getEndTime()), null, null, null,
            req.getBuildType(), req.isForce() || req.isForceMergeEmptySegment(), req.getPriorityOffset());
}
 
Example #6
Source File: JobControllerTest.java    From Kylin with Apache License 2.0 5 votes vote down vote up
@Test(expected = RuntimeException.class)
public void testResume() throws IOException {
    JobBuildRequest jobBuildRequest = new JobBuildRequest();
    jobBuildRequest.setBuildType("BUILD");
    jobBuildRequest.setStartTime(20130331080000L);
    jobBuildRequest.setEndTime(20131212080000L);
    JobInstance job = cubeController.rebuild(CUBE_NAME, jobBuildRequest);

    jobSchedulerController.resume(job.getId());
}
 
Example #7
Source File: CubeController.java    From kylin-on-parquet-v2 with Apache License 2.0 4 votes vote down vote up
/**
 * Build/Rebuild a cube segment
 */
@RequestMapping(value = "/{cubeName}/build", method = { RequestMethod.PUT }, produces = { "application/json" })
@ResponseBody
public JobInstance build(@PathVariable String cubeName, @RequestBody JobBuildRequest req) {
    return rebuild(cubeName, req);
}
 
Example #8
Source File: CubeController.java    From kylin with Apache License 2.0 4 votes vote down vote up
/**
 * Build/Rebuild a cube segment
 */
@RequestMapping(value = "/{cubeName}/build", method = { RequestMethod.PUT }, produces = { "application/json" })
@ResponseBody
public JobInstance build(@PathVariable String cubeName, @RequestBody JobBuildRequest req) {
    return rebuild(cubeName, req);
}