Repository: kylin Updated Branches: refs/heads/KYLIN-2428 [created] 4f17fa802
KYLIN-2428 Move SparkEntry to common-core Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/4f17fa80 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/4f17fa80 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/4f17fa80 Branch: refs/heads/KYLIN-2428 Commit: 4f17fa8022064532fda9f939439bdaaa74ac37dc Parents: 385d801 Author: Billy Liu <billy...@apache.org> Authored: Mon Feb 20 14:32:35 2017 +0800 Committer: Billy Liu <billy...@apache.org> Committed: Mon Feb 20 14:32:35 2017 +0800 ---------------------------------------------------------------------- .../apache/kylin/common/util/SparkEntry.java | 46 +++++++++++++++++++ .../kylin/engine/spark/SparkExecutable.java | 2 +- .../kylin/engine/spark/util/SparkEntry.java | 48 -------------------- 3 files changed, 47 insertions(+), 49 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/4f17fa80/core-common/src/main/java/org/apache/kylin/common/util/SparkEntry.java ---------------------------------------------------------------------- diff --git a/core-common/src/main/java/org/apache/kylin/common/util/SparkEntry.java b/core-common/src/main/java/org/apache/kylin/common/util/SparkEntry.java new file mode 100644 index 0000000..ce11b91 --- /dev/null +++ b/core-common/src/main/java/org/apache/kylin/common/util/SparkEntry.java @@ -0,0 +1,46 @@ +/* + * 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.common.util; + +import org.apache.commons.lang.StringUtils; + +/** + */ +public final class SparkEntry { + + public static void main(String[] args) throws Exception { + System.out.println("SparkEntry args:" + StringUtils.join(args, " ")); + if (!(args.length >= 2)) { + throw new IllegalArgumentException(String.valueOf("-className is required")); + } + if (!(args[0].equals("-className"))) { + throw new IllegalArgumentException(String.valueOf("-className is required")); + } + final String className = args[1]; + final Object o = Class.<AbstractApplication> forName(className).newInstance(); + if (!(o instanceof AbstractApplication)) { + throw new IllegalArgumentException(String.valueOf(className + " is not a subClass of AbstractApplication")); + } + String[] appArgs = new String[args.length - 2]; + for (int i = 2; i < args.length; i++) { + appArgs[i - 2] = args[i]; + } + AbstractApplication abstractApplication = (AbstractApplication) o; + abstractApplication.execute(appArgs); + } +} http://git-wip-us.apache.org/repos/asf/kylin/blob/4f17fa80/engine-spark/src/main/java/org/apache/kylin/engine/spark/SparkExecutable.java ---------------------------------------------------------------------- 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 015b480..c671a91 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 @@ -105,7 +105,7 @@ public class SparkExecutable extends AbstractExecutable { } StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.append("export HADOOP_CONF_DIR=%s && %s/bin/spark-submit --class org.apache.kylin.engine.spark.util.SparkEntry "); + stringBuilder.append("export HADOOP_CONF_DIR=%s && %s/bin/spark-submit --class org.apache.kylin.common.util.SparkEntry "); Map<String, String> sparkConfs = config.getSparkConfigOverride(); for (Map.Entry<String, String> entry : sparkConfs.entrySet()) { http://git-wip-us.apache.org/repos/asf/kylin/blob/4f17fa80/engine-spark/src/main/java/org/apache/kylin/engine/spark/util/SparkEntry.java ---------------------------------------------------------------------- diff --git a/engine-spark/src/main/java/org/apache/kylin/engine/spark/util/SparkEntry.java b/engine-spark/src/main/java/org/apache/kylin/engine/spark/util/SparkEntry.java deleted file mode 100644 index 14788fc..0000000 --- a/engine-spark/src/main/java/org/apache/kylin/engine/spark/util/SparkEntry.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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.util; - -import org.apache.commons.lang.StringUtils; - -import org.apache.kylin.common.util.AbstractApplication; - -/** - */ -public final class SparkEntry { - - public static void main(String[] args) throws Exception { - System.out.println("SparkEntry args:" + StringUtils.join(args, " ")); - if (!(args.length >= 2)) { - throw new IllegalArgumentException(String.valueOf("-className is required")); - } - if (!(args[0].equals("-className"))) { - throw new IllegalArgumentException(String.valueOf("-className is required")); - } - final String className = args[1]; - final Object o = Class.<AbstractApplication> forName(className).newInstance(); - if (!(o instanceof AbstractApplication)) { - throw new IllegalArgumentException(String.valueOf(className + " is not a subClass of AbstractSparkApplication")); - } - String[] appArgs = new String[args.length - 2]; - for (int i = 2; i < args.length; i++) { - appArgs[i - 2] = args[i]; - } - AbstractApplication abstractApplication = (AbstractApplication) o; - abstractApplication.execute(appArgs); - } -}