You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by li...@apache.org on 2017/03/12 11:48:57 UTC

[25/48] kylin git commit: KYLIN-2491 Add job in error status into job check filter when drop a cube.

KYLIN-2491 Add job in error status into job check filter when drop a cube.

Signed-off-by: Hongbin Ma <ma...@apache.org>


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

Branch: refs/heads/master-hbase0.98
Commit: 4f7885c13727c9f6975c111a57138e75ca16de7a
Parents: f1154c5
Author: nichunen <ch...@kyligence.io>
Authored: Wed Mar 8 14:41:06 2017 +0800
Committer: Hongbin Ma <ma...@apache.org>
Committed: Wed Mar 8 15:01:37 2017 +0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/kylin/rest/service/CubeService.java | 4 ++--
 .../src/main/java/org/apache/kylin/rest/service/JobService.java  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/4f7885c1/server-base/src/main/java/org/apache/kylin/rest/service/CubeService.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/service/CubeService.java b/server-base/src/main/java/org/apache/kylin/rest/service/CubeService.java
index c8c87cb..a28cedb 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/service/CubeService.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/service/CubeService.java
@@ -248,9 +248,9 @@ public class CubeService extends BasicService {
 
     @PreAuthorize(Constant.ACCESS_HAS_ROLE_ADMIN + " or hasPermission(#cube, 'ADMINISTRATION') or hasPermission(#cube, 'MANAGEMENT')")
     public void deleteCube(CubeInstance cube) throws IOException, JobException {
-        final List<CubingJob> cubingJobs = jobService.listAllCubingJobs(cube.getName(), null, EnumSet.of(ExecutableState.READY, ExecutableState.RUNNING));
+        final List<CubingJob> cubingJobs = jobService.listAllCubingJobs(cube.getName(), null, EnumSet.of(ExecutableState.READY, ExecutableState.RUNNING, ExecutableState.ERROR));
         if (!cubingJobs.isEmpty()) {
-            throw new JobException("The cube " + cube.getName() + " has running job, please discard it and try again.");
+            throw new JobException("The cube " + cube.getName() + " has running or failed job, please discard it and try again.");
         }
 
         try {

http://git-wip-us.apache.org/repos/asf/kylin/blob/4f7885c1/server-base/src/main/java/org/apache/kylin/rest/service/JobService.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/service/JobService.java b/server-base/src/main/java/org/apache/kylin/rest/service/JobService.java
index ed24a9d..893d866 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/service/JobService.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/service/JobService.java
@@ -485,7 +485,7 @@ public class JobService extends BasicService implements InitializingBean {
     }
 
     public List<CubingJob> listAllCubingJobs(final String cubeName, final String projectName, final Set<ExecutableState> statusList, final Map<String, Output> allOutputs) {
-        return listAllCubingJobs(cubeName, projectName, statusList, -1L, -1L, allOutputs);
+        return listAllCubingJobs(cubeName, projectName, statusList, 0L, Long.MAX_VALUE, allOutputs);
     }
 
     public List<CubingJob> listAllCubingJobs(final String cubeName, final String projectName, final Set<ExecutableState> statusList, long timeStartInMillis, long timeEndInMillis, final Map<String, Output> allOutputs) {