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:51 UTC
[kylin] 02/02: KYLIN-4356: add CardinalityExecutable and clean
outdate 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 1493b49e76569aa0d8e92afbdc931425486fcd60
Author: Zhou Kang <zh...@xiaomi.com>
AuthorDate: Sun Feb 16 20:58:43 2020 +0800
KYLIN-4356: add CardinalityExecutable and clean outdate job
---
.../kylin/job/execution/CardinalityExecutable.java | 29 ++++++++++++++++++++++
.../apache/kylin/rest/job/MetadataCleanupJob.java | 4 +--
.../apache/kylin/rest/service/TableService.java | 4 +--
3 files changed, 33 insertions(+), 4 deletions(-)
diff --git a/core-job/src/main/java/org/apache/kylin/job/execution/CardinalityExecutable.java b/core-job/src/main/java/org/apache/kylin/job/execution/CardinalityExecutable.java
new file mode 100644
index 0000000..ce1b4fb
--- /dev/null
+++ b/core-job/src/main/java/org/apache/kylin/job/execution/CardinalityExecutable.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+package org.apache.kylin.job.execution;
+
+/**
+ */
+public class CardinalityExecutable extends DefaultChainedExecutable {
+
+
+ public CardinalityExecutable() {
+ super();
+ }
+}
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 a49539d..f52bf55 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
@@ -44,8 +44,8 @@ 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.CardinalityExecutable;
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;
@@ -206,7 +206,7 @@ public class MetadataCleanupJob {
|| StringUtils.equals(status, ExecutableState.DISCARDED.toString())) {
isComplete = true;
}
- } else if (jobType.equals(DefaultChainedExecutable.class.getName())) {
+ } else if (jobType.equals(CardinalityExecutable.class.getName())) {
// Ignore state of DefaultChainedExecutable
isComplete = true;
}
diff --git a/server-base/src/main/java/org/apache/kylin/rest/service/TableService.java b/server-base/src/main/java/org/apache/kylin/rest/service/TableService.java
index 4c95187..8078bbe 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/service/TableService.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/service/TableService.java
@@ -49,7 +49,7 @@ import org.apache.kylin.engine.mr.common.HadoopShellExecutable;
import org.apache.kylin.engine.mr.common.MapReduceExecutable;
import org.apache.kylin.engine.spark.SparkColumnCardinality;
import org.apache.kylin.engine.spark.SparkExecutable;
-import org.apache.kylin.job.execution.DefaultChainedExecutable;
+import org.apache.kylin.job.execution.CardinalityExecutable;
import org.apache.kylin.job.execution.ExecutableManager;
import org.apache.kylin.job.execution.ExecutableState;
import org.apache.kylin.metadata.TableMetadataManager;
@@ -490,7 +490,7 @@ public class TableService extends BasicService {
throw e;
}
- DefaultChainedExecutable job = new DefaultChainedExecutable();
+ CardinalityExecutable job = new CardinalityExecutable();
//make sure the job could be scheduled when the DistributedScheduler is enable.
job.setParam("segmentId", tableName);
job.setName("Hive Column Cardinality calculation for table '" + tableName + "'");