From 8a0748f0f0149a2d9f5b5e89bdaa1ba1e3ac2885 Mon Sep 17 00:00:00 2001 From: nichunen Date: Wed, 8 Mar 2017 14:41:06 +0800 Subject: [PATCH] KYLIN-2491 Add job in error status into job check filter when drop a cube. --- .../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(-) 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 cubingJobs = jobService.listAllCubingJobs(cube.getName(), null, EnumSet.of(ExecutableState.READY, ExecutableState.RUNNING)); + final List 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 { 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 listAllCubingJobs(final String cubeName, final String projectName, final Set statusList, final Map allOutputs) { - return listAllCubingJobs(cubeName, projectName, statusList, -1L, -1L, allOutputs); + return listAllCubingJobs(cubeName, projectName, statusList, 0L, Long.MAX_VALUE, allOutputs); } public List listAllCubingJobs(final String cubeName, final String projectName, final Set statusList, long timeStartInMillis, long timeEndInMillis, final Map allOutputs) { -- 2.10.1 (Apple Git-78)