eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject incubator-eagle git commit: EAGLE-402 Fix bad dependency and add ApplicationCLI
Date Thu, 04 Aug 2016 02:58:49 GMT
Repository: incubator-eagle
Updated Branches:
  refs/heads/develop 4ad1a4182 -> 89a5bcca7


EAGLE-402 Fix bad dependency and add ApplicationCLI

Author: Hao Chen <hao@apache.org>

Closes #297 from haoch/EAGLE-402-FIX.


Project: http://git-wip-us.apache.org/repos/asf/incubator-eagle/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-eagle/commit/89a5bcca
Tree: http://git-wip-us.apache.org/repos/asf/incubator-eagle/tree/89a5bcca
Diff: http://git-wip-us.apache.org/repos/asf/incubator-eagle/diff/89a5bcca

Branch: refs/heads/develop
Commit: 89a5bcca7fb71756f9edb46e4b3150c7868a943f
Parents: 4ad1a41
Author: Hao Chen <hao@apache.org>
Authored: Thu Aug 4 10:58:33 2016 +0800
Committer: Hao Chen <hao@apache.org>
Committed: Thu Aug 4 10:58:33 2016 +0800

----------------------------------------------------------------------
 .../org/apache/eagle/app/ApplicationCLI.java    | 41 ++++++++++++++++++++
 eagle-jpm/eagle-jpm-app/pom.xml                 |  5 ---
 .../eagle/app/jpm/JPMApplicationTest.java       |  3 +-
 3 files changed, 43 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/89a5bcca/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/ApplicationCLI.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/ApplicationCLI.java
b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/ApplicationCLI.java
new file mode 100644
index 0000000..bee2bed
--- /dev/null
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/ApplicationCLI.java
@@ -0,0 +1,41 @@
+/*
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.eagle.app;
+
+/**
+ * Usage: java org.apache.eagle.app.ApplicationCLI [APPLICATION_CLASS] [APPLICATION_OPTIONS:
-D Key=Value]
+ */
+public class ApplicationCLI {
+    /**
+     * @param args
+     * @throws ClassNotFoundException
+     * @throws IllegalAccessException
+     * @throws InstantiationException
+     */
+    public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException,
InstantiationException {
+        if(args.length < 1){
+            System.err.println("Usage: java "+ApplicationCLI.class.getName()+" [APPLICATION_CLASS]
[APPLICATION_OPTIONS: -D Key=Value]");
+            System.exit(1);
+        } else {
+            String appClassName = args[0];
+            Class<? extends ApplicationTool> appClass = (Class<? extends ApplicationTool>)
Class.forName(appClassName);
+            String[] appArgs = new String[args.length-1];
+            System.arraycopy(args, 1, appArgs, 0, args.length - 1);
+            appClass.newInstance().run(appArgs);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/89a5bcca/eagle-jpm/eagle-jpm-app/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-app/pom.xml b/eagle-jpm/eagle-jpm-app/pom.xml
index fd65188..1b545d1 100644
--- a/eagle-jpm/eagle-jpm-app/pom.xml
+++ b/eagle-jpm/eagle-jpm-app/pom.xml
@@ -31,11 +31,6 @@
             <artifactId>eagle-app-base</artifactId>
             <version>${project.version}</version>
         </dependency>
-        <dependency>
-            <groupId>org.apache.hadoop</groupId>
-            <artifactId>hadoop-yarn-server-common</artifactId>
-            <version>2.7.0</version>
-        </dependency>
     </dependencies>
     <build>
         <resources>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/89a5bcca/eagle-jpm/eagle-jpm-app/src/test/java/org/apache/eagle/app/jpm/JPMApplicationTest.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-app/src/test/java/org/apache/eagle/app/jpm/JPMApplicationTest.java
b/eagle-jpm/eagle-jpm-app/src/test/java/org/apache/eagle/app/jpm/JPMApplicationTest.java
index 645a193..30bbc96 100644
--- a/eagle-jpm/eagle-jpm-app/src/test/java/org/apache/eagle/app/jpm/JPMApplicationTest.java
+++ b/eagle-jpm/eagle-jpm-app/src/test/java/org/apache/eagle/app/jpm/JPMApplicationTest.java
@@ -31,7 +31,8 @@ import org.junit.runner.RunWith;
 public class JPMApplicationTest {
     @Inject
     private SiteResource siteResource;
-    @Inject private ApplicationResource applicationResource;
+    @Inject
+    private ApplicationResource applicationResource;
 
     /**
      * register site


Mime
View raw message