Java Code Examples for org.apache.kylin.cube.CubeInstance#getDisplayName()
The following examples show how to use
org.apache.kylin.cube.CubeInstance#getDisplayName() .
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: JobInfoConverter.java From kylin-on-parquet-v2 with Apache License 2.0 | 5 votes |
public static JobSearchResult parseToJobSearchResult(DefaultChainedExecutable job, Map<String, ExecutableOutputPO> outputs) { if (job == null) { logger.warn("job is null."); return null; } ExecutableOutputPO output = outputs.get(job.getId()); if (output == null) { logger.warn("job output is null."); return null; } final JobSearchResult result = new JobSearchResult(); String cubeName = CubingExecutableUtil.getCubeName(job.getParams()); if (cubeName == null) { cubeName = job.getParam("model_name"); } else { CubeInstance cube = CubeManager.getInstance(KylinConfig.getInstanceFromEnv()).getCube(cubeName); if (cube != null) { cubeName = cube.getDisplayName(); } } result.setCubeName(cubeName); result.setId(job.getId()); result.setJobName(job.getName()); result.setLastModified(output.getLastModified()); result.setJobStatus(JobInfoConverter.parseToJobStatus(job.getStatus())); return result; }
Example 2
Source File: JobInfoConverter.java From kylin with Apache License 2.0 | 5 votes |
public static JobSearchResult parseToJobSearchResult(DefaultChainedExecutable job, Map<String, ExecutableOutputPO> outputs) { if (job == null) { logger.warn("job is null."); return null; } ExecutableOutputPO output = outputs.get(job.getId()); if (output == null) { logger.warn("job output is null."); return null; } final JobSearchResult result = new JobSearchResult(); String cubeName = CubingExecutableUtil.getCubeName(job.getParams()); if (cubeName == null) { cubeName = job.getParam("model_name"); } else { CubeInstance cube = CubeManager.getInstance(KylinConfig.getInstanceFromEnv()).getCube(cubeName); if (cube != null) { cubeName = cube.getDisplayName(); } } result.setCubeName(cubeName); result.setId(job.getId()); result.setJobName(job.getName()); result.setLastModified(output.getLastModified()); result.setJobStatus(JobInfoConverter.parseToJobStatus(job.getStatus())); return result; }
Example 3
Source File: JobInfoConverter.java From kylin with Apache License 2.0 | 4 votes |
public static JobInstance parseToJobInstance(CubingJob job, Map<String, Output> outputs) { if (job == null) { logger.warn("job is null."); return null; } Output output = outputs.get(job.getId()); if (output == null) { logger.warn("job output is null."); return null; } CubingJob cubeJob = job; String cubeName = CubingExecutableUtil.getCubeName(cubeJob.getParams()); String displayCubeName = cubeName; try { CubeInstance cube = CubeManager.getInstance(KylinConfig.getInstanceFromEnv()).getCube(cubeName); if (cube != null) { cubeName = cube.getName(); displayCubeName = cube.getDisplayName(); } } catch (Exception e) { logger.warn("Fail to get cube instance for {}.", cubeName); } final JobInstance result = new JobInstance(); result.setName(job.getName()); result.setProjectName(cubeJob.getProjectName()); result.setRelatedCube(cubeName); result.setDisplayCubeName(displayCubeName); result.setRelatedSegment(CubingExecutableUtil.getSegmentId(cubeJob.getParams())); result.setRelatedSegmentName(CubingExecutableUtil.getSegmentName(cubeJob.getParams())); result.setLastModified(output.getLastModified()); result.setSubmitter(job.getSubmitter()); result.setUuid(job.getId()); result.setType(CubeBuildTypeEnum.BUILD); result.setStatus(parseToJobStatus(output.getState())); result.setBuildInstance(AbstractExecutable.getBuildInstance(output)); result.setMrWaiting(AbstractExecutable.getExtraInfoAsLong(output, CubingJob.MAP_REDUCE_WAIT_TIME, 0L) / 1000); result.setExecStartTime(AbstractExecutable.getStartTime(output)); result.setExecEndTime(AbstractExecutable.getEndTime(output)); result.setExecInterruptTime(AbstractExecutable.getInterruptTime(output)); result.setDuration(AbstractExecutable.getDuration(result.getExecStartTime(), result.getExecEndTime(), result.getExecInterruptTime()) / 1000); for (int i = 0; i < job.getTasks().size(); ++i) { AbstractExecutable task = job.getTasks().get(i); result.addStep(parseToJobStep(task, i, outputs.get(task.getId()))); } return result; }