public CheckpointExecutable build() { KylinConfig kylinConfig = cube.getConfig(); List<ProjectInstance> projList = ProjectManager.getInstance(kylinConfig).findProjects(cube.getType(), cube.getName()); if (projList == null || projList.size() == 0) { throw new RuntimeException("Cannot find the project containing the cube " + cube.getName() + "!!!"); } else if (projList.size() >= 2) { throw new RuntimeException("Find more than one project containing the cube " + cube.getName() + ". It does't meet the uniqueness requirement!!! "); } CheckpointExecutable checkpointJob = new CheckpointExecutable(); checkpointJob.setSubmitter(submitter); CubingExecutableUtil.setCubeName(cube.getName(), checkpointJob.getParams()); checkpointJob.setName( cube.getName() + " - OPTIMIZE CHECKPOINT - " + format.format(new Date(System.currentTimeMillis()))); checkpointJob.setDeployEnvName(kylinConfig.getDeployEnv()); checkpointJob.setProjectName(projList.get(0).getName()); // Phase 1: Update cube information checkpointJob.addTask(createUpdateCubeInfoAfterCheckpointStep()); // Phase 2: Garbage collection outputSide.addStepPhase5_Cleanup(checkpointJob); return checkpointJob; }
public CheckpointExecutable build() { KylinConfig kylinConfig = cube.getConfig(); List<ProjectInstance> projList = ProjectManager.getInstance(kylinConfig).findProjects(cube.getType(), cube.getName()); if (projList == null || projList.size() == 0) { throw new RuntimeException("Cannot find the project containing the cube " + cube.getName() + "!!!"); } else if (projList.size() >= 2) { throw new RuntimeException("Find more than one project containing the cube " + cube.getName() + ". It does't meet the uniqueness requirement!!! "); } CheckpointExecutable checkpointJob = new CheckpointExecutable(); checkpointJob.setSubmitter(submitter); CubingExecutableUtil.setCubeName(cube.getName(), checkpointJob.getParams()); checkpointJob.setName( cube.getName() + " - OPTIMIZE CHECKPOINT - " + format.format(new Date(System.currentTimeMillis()))); checkpointJob.setDeployEnvName(kylinConfig.getDeployEnv()); checkpointJob.setProjectName(projList.get(0).getName()); // Phase 1: Update cube information checkpointJob.addTask(createUpdateCubeInfoAfterCheckpointStep()); // Phase 2: Garbage collection outputSide.addStepPhase5_Cleanup(checkpointJob); return checkpointJob; }