You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by sh...@apache.org on 2020/02/28 12:02:50 UTC

[kylin] 01/02: KYLIN-4356: clean outdate DefaultChainedExecutable job

This is an automated email from the ASF dual-hosted git repository.

shaofengshi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kylin.git

commit b5d444b689a559725e9d1d53e6664e3eeec92f93
Author: Zhou Kang <zh...@xiaomi.com>
AuthorDate: Sun Jan 19 19:37:10 2020 +0800

    KYLIN-4356: clean outdate DefaultChainedExecutable job
---
 .../java/org/apache/kylin/rest/job/MetadataCleanupJob.java | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/server-base/src/main/java/org/apache/kylin/rest/job/MetadataCleanupJob.java b/server-base/src/main/java/org/apache/kylin/rest/job/MetadataCleanupJob.java
index cb56c25..a49539d 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/job/MetadataCleanupJob.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/job/MetadataCleanupJob.java
@@ -39,10 +39,13 @@ import org.apache.kylin.cube.CubeManager;
 import org.apache.kylin.cube.CubeSegment;
 import org.apache.kylin.dict.DictionaryInfo;
 import org.apache.kylin.dict.DictionaryInfoSerializer;
+import org.apache.kylin.engine.mr.CubingJob;
 import org.apache.kylin.job.dao.ExecutableDao;
 import org.apache.kylin.job.dao.ExecutableOutputPO;
 import org.apache.kylin.job.dao.ExecutablePO;
 import org.apache.kylin.job.exception.PersistentException;
+import org.apache.kylin.job.execution.CheckpointExecutable;
+import org.apache.kylin.job.execution.DefaultChainedExecutable;
 import org.apache.kylin.job.execution.ExecutableState;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -196,8 +199,15 @@ public class MetadataCleanupJob {
         try {
             ExecutableOutputPO output = executableDao.getJobOutput(jobId);
             String status = output.getStatus();
-            if (StringUtils.equals(status, ExecutableState.SUCCEED.toString())
-                    || StringUtils.equals(status, ExecutableState.DISCARDED.toString())) {
+            String jobType = job.getType();
+            if (jobType.equals(CubingJob.class.getName())
+                    || jobType.equals(CheckpointExecutable.class.getName())) {
+                if (StringUtils.equals(status, ExecutableState.SUCCEED.toString())
+                        || StringUtils.equals(status, ExecutableState.DISCARDED.toString())) {
+                    isComplete = true;
+                }
+            } else if (jobType.equals(DefaultChainedExecutable.class.getName())) {
+                // Ignore state of DefaultChainedExecutable
                 isComplete = true;
             }
         } catch (PersistentException e) {