Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KYLIN-3918: Add project name in cube and job pages #560

Merged
merged 1 commit into from Apr 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion core-job/src/main/java/org/apache/kylin/job/JobInstance.java
Expand Up @@ -46,7 +46,8 @@ public class JobInstance extends RootPersistentEntity implements Comparable<JobI

@JsonProperty("name")
private String name;

@JsonProperty("projectName")
private String projectName;
@JsonProperty("type")
private CubeBuildTypeEnum type; // java implementation
@JsonProperty("duration")
Expand Down Expand Up @@ -157,6 +158,14 @@ public void setName(String name) {
this.name = name;
}

public String getProjectName() {
return projectName;
}

public void setProjectName(String projectName) {
this.projectName = projectName;
}

public CubeBuildTypeEnum getType() {
return type;
}
Expand Down
Expand Up @@ -79,6 +79,7 @@ public static JobInstance parseToJobInstance(CubingJob job, Map<String, Output>

final JobInstance result = new JobInstance();
result.setName(job.getName());
result.setProjectName(cubeJob.getProjectName());
result.setRelatedCube(cube != null ? cube.getName() : CubingExecutableUtil.getCubeName(cubeJob.getParams()));
result.setDisplayCubeName(cube != null ? cube.getDisplayName() : CubingExecutableUtil.getCubeName(cubeJob.getParams()));
result.setRelatedSegment(CubingExecutableUtil.getSegmentId(cubeJob.getParams()));
Expand Down Expand Up @@ -115,6 +116,7 @@ public static JobInstance parseToJobInstance(CheckpointExecutable job, Map<Strin

final JobInstance result = new JobInstance();
result.setName(job.getName());
result.setProjectName(job.getProjectName());
result.setRelatedCube(CubingExecutableUtil.getCubeName(job.getParams()));
result.setDisplayCubeName(CubingExecutableUtil.getCubeName(job.getParams()));
result.setLastModified(output.getLastModified());
Expand Down
Expand Up @@ -479,6 +479,7 @@ protected JobInstance getSingleJobInstance(AbstractExecutable job) {
Output output = cubeJob.getOutput();
final JobInstance result = new JobInstance();
result.setName(job.getName());
result.setProjectName(cubeJob.getProjectName());
if (cube != null) {
result.setRelatedCube(cube.getName());
result.setDisplayCubeName(cube.getDisplayName());
Expand Down Expand Up @@ -513,6 +514,7 @@ protected JobInstance getLookupSnapshotBuildJobInstance(LookupSnapshotBuildJob j
Output output = job.getOutput();
final JobInstance result = new JobInstance();
result.setName(job.getName());
result.setProjectName(job.getProjectName());
result.setRelatedCube(CubingExecutableUtil.getCubeName(job.getParams()));
result.setRelatedSegment(CubingExecutableUtil.getSegmentId(job.getParams()));
result.setLastModified(job.getLastModified());
Expand Down Expand Up @@ -546,6 +548,7 @@ protected JobInstance getCheckpointJobInstance(AbstractExecutable job) {
Output output = checkpointExecutable.getOutput();
final JobInstance result = new JobInstance();
result.setName(job.getName());
result.setProjectName(checkpointExecutable.getProjectName());
result.setRelatedCube(CubingExecutableUtil.getCubeName(job.getParams()));
result.setDisplayCubeName(CubingExecutableUtil.getCubeName(job.getParams()));
result.setLastModified(job.getLastModified());
Expand Down
Expand Up @@ -130,6 +130,7 @@ private JobInstance parseToJobInstance(CubingJob cubeJob, Map<String, Output> ou
Output output = outputs.get(cubeJob.getId());
final JobInstance result = new JobInstance();
result.setName(cubeJob.getName());
result.setProjectName(cubeJob.getProjectName());
if (cube != null) {
result.setRelatedCube(cube.getName());
result.setDisplayCubeName(cube.getDisplayName());
Expand Down
3 changes: 2 additions & 1 deletion webapp/app/js/model/cubeConfig.js
Expand Up @@ -80,6 +80,7 @@ KylinApp.constant('cubeConfig', {
theaditems: [
{attr: 'name', name: 'Name'},
{attr: 'status', name: 'Status'},
{attr: 'project', name: 'Project'},
{attr: 'size_kb', name: 'Cube Size'},
{attr: 'input_records_count', name: 'Source Records'},
{attr: 'last_build_time', name: 'Last Build Time'},
Expand Down Expand Up @@ -200,4 +201,4 @@ KylinApp.constant('cubeConfig', {
'left': '-12px'
}
}
});
});
1 change: 1 addition & 0 deletions webapp/app/partials/cubes/cubes.html
Expand Up @@ -70,6 +70,7 @@
{{ cube.status}}
</span>
</td>
<td>{{ cube.project}}</td>
<td><span tooltip-html-unsafe="<div style='text-align:left'>
Source Table Size: {{dataSize(cube.input_records_size)}}<br/>
Expansion Rate: {{(cube.input_records_size>0? cube.size_kb*1024/cube.input_records_size : 0) * 100 | number:2}}%
Expand Down
6 changes: 6 additions & 0 deletions webapp/app/partials/jobs/job_steps.html
Expand Up @@ -40,6 +40,12 @@
{{state.selectedJob.uuid}}
</td>
</tr>
<tr>
<td><b>Project Name</b></td>
<td style="max-width: 180px;word-wrap: break-word;word-break: normal;">
{{state.selectedJob.projectName}}
</td>
</tr>
<tr>
<td><b>Status</b></td>
<td>
Expand Down