You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by ma...@apache.org on 2015/05/15 07:22:49 UTC

[5/5] incubator-kylin git commit: KYLIN-765 When a cube job is failed, still be possible to submit a new job

KYLIN-765 When a cube job is failed, still be possible to submit a new job

Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/531ed58b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/531ed58b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/531ed58b

Branch: refs/heads/0.6
Commit: 531ed58b6cf811679aecfdd5acdc8cb42b589256
Parents: bbdadcb
Author: Shao Feng, Shi <sh...@ebay.com>
Authored: Thu May 14 15:17:13 2015 +0800
Committer: Shao Feng, Shi <sh...@ebay.com>
Committed: Thu May 14 15:17:13 2015 +0800

----------------------------------------------------------------------
 server/src/main/java/com/kylinolap/rest/service/JobService.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/531ed58b/server/src/main/java/com/kylinolap/rest/service/JobService.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/com/kylinolap/rest/service/JobService.java b/server/src/main/java/com/kylinolap/rest/service/JobService.java
index af4f16f..9d15ea0 100644
--- a/server/src/main/java/com/kylinolap/rest/service/JobService.java
+++ b/server/src/main/java/com/kylinolap/rest/service/JobService.java
@@ -100,7 +100,7 @@ public class JobService extends BasicService {
 
         List<JobInstance> jobInstances = this.getJobManager().listJobs(cube.getName(), null);
         for (JobInstance jobInstance : jobInstances) {
-            if (jobInstance.getStatus() == JobStatusEnum.PENDING || jobInstance.getStatus() == JobStatusEnum.RUNNING) {
+            if (jobInstance.getStatus() == JobStatusEnum.PENDING || jobInstance.getStatus() == JobStatusEnum.RUNNING || jobInstance.getStatus() == JobStatusEnum.ERROR) {
                 throw new JobException("The cube " + cube.getName() + " has running job(" + jobInstance.getUuid() + ") please discard it and try again.");
             }
         }
@@ -142,7 +142,7 @@ public class JobService extends BasicService {
         CubeInstance cube = this.getCubeManager().getCube(job.getRelatedCube());
         List<JobInstance> jobs = this.getJobManager().listJobs(cube.getName(), null);
         for (JobInstance jobInstance : jobs) {
-            if (jobInstance.getStatus() != JobStatusEnum.DISCARDED && jobInstance.getStatus() != JobStatusEnum.FINISHED) {
+            if (jobInstance.getStatus() != JobStatusEnum.DISCARDED && jobInstance.getStatus() != JobStatusEnum.FINISHED && jobInstance.getUuid().equals(job.getUuid())) {
                 this.getJobManager().discardJob(jobInstance.getUuid());
             }
         }