Repository: kylin Updated Branches: refs/heads/KYLIN-2428 93507a654 -> 1cb15c0c9
KYLIN-2428 move SparkEntry from common to engine-spark Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/1cb15c0c Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/1cb15c0c Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/1cb15c0c Branch: refs/heads/KYLIN-2428 Commit: 1cb15c0c96c46cd3e97f4f313260e85b2acd2762 Parents: 93507a6 Author: Billy Liu <billy...@apache.org> Authored: Mon Feb 13 10:31:14 2017 +0800 Committer: Billy Liu <billy...@apache.org> Committed: Mon Feb 13 10:31:14 2017 +0800 ---------------------------------------------------------------------- .../apache/kylin/common/util/SparkEntry.java | 42 ----------------- .../kylin/engine/spark/util/SparkEntry.java | 48 ++++++++++++++++++++ 2 files changed, 48 insertions(+), 42 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/1cb15c0c/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 deleted file mode 100644 index fd324a2..0000000 --- a/core-common/src/main/java/org/apache/kylin/common/util/SparkEntry.java +++ /dev/null @@ -1,42 +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.common.util; - -import org.apache.commons.lang3.StringUtils; - -import com.google.common.base.Preconditions; - -/** - */ -public final class SparkEntry { - - public static void main(String[] args) throws Exception { - System.out.println("SparkEntry args:" + StringUtils.join(args, " ")); - Preconditions.checkArgument(args.length >= 2, "-className is required"); - Preconditions.checkArgument(args[0].equals("-className"), "-className is required"); - final String className = args[1]; - final Object o = Class.<AbstractApplication> forName(className).newInstance(); - Preconditions.checkArgument(o instanceof AbstractApplication, 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); - } -} http://git-wip-us.apache.org/repos/asf/kylin/blob/1cb15c0c/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 new file mode 100644 index 0000000..14788fc --- /dev/null +++ b/engine-spark/src/main/java/org/apache/kylin/engine/spark/util/SparkEntry.java @@ -0,0 +1,48 @@ +/* + * 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); + } +}