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 2019/03/11 06:38:32 UTC

[kylin] branch 2.6.x updated: KYLIN-3838 Fix retry mechanism is invalid when build with spark

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

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


The following commit(s) were added to refs/heads/2.6.x by this push:
     new 9d7db8e  KYLIN-3838 Fix retry mechanism is invalid when build with spark
9d7db8e is described below

commit 9d7db8e060075d1d24e4b2a880b25f441ddcca97
Author: chao long <wa...@qq.com>
AuthorDate: Mon Mar 4 10:52:53 2019 +0800

    KYLIN-3838 Fix retry mechanism is invalid when build with spark
---
 .../apache/kylin/engine/spark/SparkExecutable.java |  6 ++--
 .../engine/spark/exception/SparkException.java     | 39 ++++++++++++++++++++++
 2 files changed, 43 insertions(+), 2 deletions(-)

diff --git a/engine-spark/src/main/java/org/apache/kylin/engine/spark/SparkExecutable.java b/engine-spark/src/main/java/org/apache/kylin/engine/spark/SparkExecutable.java
index e4f8c43..8c4b99d 100644
--- a/engine-spark/src/main/java/org/apache/kylin/engine/spark/SparkExecutable.java
+++ b/engine-spark/src/main/java/org/apache/kylin/engine/spark/SparkExecutable.java
@@ -45,6 +45,7 @@ import org.apache.kylin.cube.CubeSegment;
 import org.apache.kylin.engine.mr.CubingJob;
 import org.apache.kylin.engine.mr.common.BatchConstants;
 import org.apache.kylin.engine.mr.common.JobRelatedMetaUtil;
+import org.apache.kylin.engine.spark.exception.SparkException;
 import org.apache.kylin.job.common.PatternedLogger;
 import org.apache.kylin.job.constant.ExecutableConstants;
 import org.apache.kylin.job.exception.ExecuteException;
@@ -339,9 +340,10 @@ public class SparkExecutable extends AbstractExecutable {
                 extra = mgr.getOutput(getId()).getExtra();
                 extra.put(ExecutableConstants.SPARK_JOB_ID, "");
                 getManager().addJobInfo(getId(), extra);
-                return new ExecuteResult(ExecuteResult.State.ERROR, result != null ? result.getSecond() : "");
+
+                return ExecuteResult.createFailed(new SparkException(result != null ? result.getSecond() : ""));
             } catch (Exception e) {
-                logger.error("error run spark job:", e);
+                logger.error("Error run spark job:", e);
                 return ExecuteResult.createError(e);
             }
         }
diff --git a/engine-spark/src/main/java/org/apache/kylin/engine/spark/exception/SparkException.java b/engine-spark/src/main/java/org/apache/kylin/engine/spark/exception/SparkException.java
new file mode 100644
index 0000000..15c0f48
--- /dev/null
+++ b/engine-spark/src/main/java/org/apache/kylin/engine/spark/exception/SparkException.java
@@ -0,0 +1,39 @@
+/*
+ * 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.engine.spark.exception;
+
+public class SparkException extends Exception {
+
+    public SparkException(String message) {
+        super(message);
+    }
+
+    public SparkException(Throwable cause) {
+        super(cause);
+    }
+
+    public SparkException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public SparkException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
+        super(message, cause, enableSuppression, writableStackTrace);
+    }
+
+}