eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jinh...@apache.org
Subject incubator-eagle git commit: [EAGLE-642] move application runtime configure to ApplicationEntity context
Date Thu, 20 Oct 2016 08:01:15 GMT
Repository: incubator-eagle
Updated Branches:
  refs/heads/master c3bdf46ca -> 8991b61e2


[EAGLE-642] move application runtime configure to ApplicationEntity context

Author: wujinhu <wujinhu920@126.com>

Closes #537 from wujinhu/EAGLE-644.


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

Branch: refs/heads/master
Commit: 8991b61e2dcf92aaf76ffba7cd15f344cf9495d5
Parents: c3bdf46
Author: wujinhu <wujinhu920@126.com>
Authored: Thu Oct 20 16:01:08 2016 +0800
Committer: wujinhu <wujinhu920@126.com>
Committed: Thu Oct 20 16:01:08 2016 +0800

----------------------------------------------------------------------
 .../org/apache/eagle/app/service/ApplicationAction.java   |  7 +------
 .../service/impl/ApplicationManagementServiceImpl.java    |  5 +++++
 .../service/impl/ApplicationStatusUpdateServiceImpl.java  |  4 +++-
 .../eagle/app/example/ExampleApplicationProviderTest.java | 10 ----------
 .../hadoop/queue/HadoopQueueRunningAppProviderTest.java   |  1 -
 ...gle.jpm.aggregation.AggregationApplicationProvider.xml |  2 +-
 ...gle.jpm.mr.history.MRHistoryJobApplicationProvider.xml |  2 +-
 .../mr/history/MRHistoryJobApplicationProviderTest.java   |  1 -
 ...gle.jpm.mr.running.MRRunningJobApplicationProvider.xml |  6 +++---
 .../mr/running/MRRunningJobApplicationProviderTest.java   |  3 +--
 .../src/test/java/SparkHistoryJobAppProviderTest.java     |  3 +--
 .../src/test/java/SparkRunningJobAppProviderTest.java     |  3 +--
 12 files changed, 17 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/8991b61e/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationAction.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationAction.java
b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationAction.java
index cecd81e..aea52c8 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationAction.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationAction.java
@@ -70,12 +70,7 @@ public class ApplicationAction implements Serializable {
             executionConfig = Collections.emptyMap();
         }
 
-        // TODO: Decouple hardcoded configuration key
-        executionConfig.put("siteId", metadata.getSite().getSiteId());
-        executionConfig.put("mode", metadata.getMode().name());
-        executionConfig.put("appId", metadata.getAppId());
-        executionConfig.put("jarPath", metadata.getJarPath());
-        this.config = ConfigFactory.parseMap(executionConfig).withFallback(envConfig);
+        this.config = ConfigFactory.parseMap(executionConfig).withFallback(envConfig).withFallback(ConfigFactory.parseMap(metadata.getContext()));
         this.alertMetadataService = alertMetadataService;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/8991b61e/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/impl/ApplicationManagementServiceImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/impl/ApplicationManagementServiceImpl.java
b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/impl/ApplicationManagementServiceImpl.java
index 6dee1fc..6163a8f 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/impl/ApplicationManagementServiceImpl.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/impl/ApplicationManagementServiceImpl.java
@@ -100,6 +100,11 @@ public class ApplicationManagementServiceImpl implements ApplicationManagementSe
         }
         applicationEntity.setConfiguration(appConfig);
 
+        applicationEntity.getContext().put("siteId", siteEntity.getSiteId());
+        applicationEntity.getContext().put("mode", applicationEntity.getMode().name());
+        applicationEntity.getContext().put("appId", applicationEntity.getAppId());
+        applicationEntity.getContext().put("jarPath", applicationEntity.getJarPath());
+
         // Validate Dependency
         validateDependingApplicationInstalled(applicationEntity);
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/8991b61e/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/impl/ApplicationStatusUpdateServiceImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/impl/ApplicationStatusUpdateServiceImpl.java
b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/impl/ApplicationStatusUpdateServiceImpl.java
index 2e7b6a2..b6b27b2 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/impl/ApplicationStatusUpdateServiceImpl.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/impl/ApplicationStatusUpdateServiceImpl.java
@@ -53,7 +53,9 @@ public class ApplicationStatusUpdateServiceImpl extends  ApplicationStatusUpdate
         try {
             Collection<ApplicationEntity> applicationEntities = applicationEntityService.findAll();
             for (ApplicationEntity applicationEntity: applicationEntities) {
-                updateApplicationEntityStatus(applicationEntity);
+                if (applicationEntity.getDescriptor().isExecutable()) {
+                    updateApplicationEntityStatus(applicationEntity);
+                }
             }
         } catch (Exception e) {
             LOG.error("failed to update app status", e);

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/8991b61e/eagle-examples/eagle-app-example/src/test/java/org/apache/eagle/app/example/ExampleApplicationProviderTest.java
----------------------------------------------------------------------
diff --git a/eagle-examples/eagle-app-example/src/test/java/org/apache/eagle/app/example/ExampleApplicationProviderTest.java
b/eagle-examples/eagle-app-example/src/test/java/org/apache/eagle/app/example/ExampleApplicationProviderTest.java
index e08456d..c8989e3 100644
--- a/eagle-examples/eagle-app-example/src/test/java/org/apache/eagle/app/example/ExampleApplicationProviderTest.java
+++ b/eagle-examples/eagle-app-example/src/test/java/org/apache/eagle/app/example/ExampleApplicationProviderTest.java
@@ -103,16 +103,6 @@ public class ExampleApplicationProviderTest extends ApplicationTestBase
{
         }
     }
 
-    @Test
-    public void testApplicationQuickRunWithAppType() {
-        simulator.start("EXAMPLE_APPLICATION", getConf());
-    }
-
-    @Test
-    public void testApplicationQuickRunWithAppProvider() throws Exception {
-        simulator.start(ExampleApplicationProvider.class, getConf());
-    }
-
     private Map<String, Object> getConf() {
         Map<String, Object> conf = new HashMap<>();
         conf.put("dataSinkConfig.topic", "testTopic");

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/8991b61e/eagle-jpm/eagle-hadoop-queue/src/test/java/org/apache/eagle/hadoop/queue/HadoopQueueRunningAppProviderTest.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-hadoop-queue/src/test/java/org/apache/eagle/hadoop/queue/HadoopQueueRunningAppProviderTest.java
b/eagle-jpm/eagle-hadoop-queue/src/test/java/org/apache/eagle/hadoop/queue/HadoopQueueRunningAppProviderTest.java
index 633e802..6259aaf 100644
--- a/eagle-jpm/eagle-hadoop-queue/src/test/java/org/apache/eagle/hadoop/queue/HadoopQueueRunningAppProviderTest.java
+++ b/eagle-jpm/eagle-hadoop-queue/src/test/java/org/apache/eagle/hadoop/queue/HadoopQueueRunningAppProviderTest.java
@@ -27,6 +27,5 @@ public class HadoopQueueRunningAppProviderTest extends ApplicationTestBase
{
 
     @Test
     public void testRunAsManagedApplicationWithSimulator() {
-        simulator.start(HadoopQueueRunningAppProvider.class);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/8991b61e/eagle-jpm/eagle-jpm-aggregation/src/main/resources/META-INF/providers/org.apache.eagle.jpm.aggregation.AggregationApplicationProvider.xml
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-aggregation/src/main/resources/META-INF/providers/org.apache.eagle.jpm.aggregation.AggregationApplicationProvider.xml
b/eagle-jpm/eagle-jpm-aggregation/src/main/resources/META-INF/providers/org.apache.eagle.jpm.aggregation.AggregationApplicationProvider.xml
index aa35d11..956f134 100644
--- a/eagle-jpm/eagle-jpm-aggregation/src/main/resources/META-INF/providers/org.apache.eagle.jpm.aggregation.AggregationApplicationProvider.xml
+++ b/eagle-jpm/eagle-jpm-aggregation/src/main/resources/META-INF/providers/org.apache.eagle.jpm.aggregation.AggregationApplicationProvider.xml
@@ -18,7 +18,7 @@
 
 <application>
     <type>MR_JPM_AGGREGATION_APP</type>
-    <name>Map Reduce Job Metrics Aggregation Application</name>
+    <name>Map Reduce Job Metrics Aggregation</name>
     <version>0.5.0-incubating</version>
     <configuration>
         <property>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/8991b61e/eagle-jpm/eagle-jpm-mr-history/src/main/resources/META-INF/providers/org.apache.eagle.jpm.mr.history.MRHistoryJobApplicationProvider.xml
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-mr-history/src/main/resources/META-INF/providers/org.apache.eagle.jpm.mr.history.MRHistoryJobApplicationProvider.xml
b/eagle-jpm/eagle-jpm-mr-history/src/main/resources/META-INF/providers/org.apache.eagle.jpm.mr.history.MRHistoryJobApplicationProvider.xml
index ee09d50..6f44b3d 100644
--- a/eagle-jpm/eagle-jpm-mr-history/src/main/resources/META-INF/providers/org.apache.eagle.jpm.mr.history.MRHistoryJobApplicationProvider.xml
+++ b/eagle-jpm/eagle-jpm-mr-history/src/main/resources/META-INF/providers/org.apache.eagle.jpm.mr.history.MRHistoryJobApplicationProvider.xml
@@ -18,7 +18,7 @@
 
 <application>
     <type>MR_HISTORY_JOB_APP</type>
-    <name>Map Reduce History Job Monitoring</name>
+    <name>Map Reduce History Job</name>
     <version>0.5.0-incubating</version>
     <configuration>
         <!-- org.apache.eagle.jpm.mr.history.MRHistoryJobConfig -->

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/8991b61e/eagle-jpm/eagle-jpm-mr-history/src/test/java/org/apache/eagle/jpm/mr/history/MRHistoryJobApplicationProviderTest.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-mr-history/src/test/java/org/apache/eagle/jpm/mr/history/MRHistoryJobApplicationProviderTest.java
b/eagle-jpm/eagle-jpm-mr-history/src/test/java/org/apache/eagle/jpm/mr/history/MRHistoryJobApplicationProviderTest.java
index 0001986..343b636 100644
--- a/eagle-jpm/eagle-jpm-mr-history/src/test/java/org/apache/eagle/jpm/mr/history/MRHistoryJobApplicationProviderTest.java
+++ b/eagle-jpm/eagle-jpm-mr-history/src/test/java/org/apache/eagle/jpm/mr/history/MRHistoryJobApplicationProviderTest.java
@@ -27,6 +27,5 @@ public class MRHistoryJobApplicationProviderTest extends ApplicationTestBase
{
 
     @Test
     public void testRunAsManagedApplicationWithSimulator() {
-        simulator.start(MRHistoryJobApplicationProvider.class);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/8991b61e/eagle-jpm/eagle-jpm-mr-running/src/main/resources/META-INF/providers/org.apache.eagle.jpm.mr.running.MRRunningJobApplicationProvider.xml
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-mr-running/src/main/resources/META-INF/providers/org.apache.eagle.jpm.mr.running.MRRunningJobApplicationProvider.xml
b/eagle-jpm/eagle-jpm-mr-running/src/main/resources/META-INF/providers/org.apache.eagle.jpm.mr.running.MRRunningJobApplicationProvider.xml
index d57629a..2e91468 100644
--- a/eagle-jpm/eagle-jpm-mr-running/src/main/resources/META-INF/providers/org.apache.eagle.jpm.mr.running.MRRunningJobApplicationProvider.xml
+++ b/eagle-jpm/eagle-jpm-mr-running/src/main/resources/META-INF/providers/org.apache.eagle.jpm.mr.running.MRRunningJobApplicationProvider.xml
@@ -18,14 +18,14 @@
 
 <application>
     <type>MR_RUNNING_JOB_APP</type>
-    <name>Map Reduce Running Job Monitoring</name>
+    <name>Map Reduce Running Job</name>
     <version>0.5.0-incubating</version>
     <configuration>
         <property>
             <name>workers</name>
             <displayName>Worker Number</displayName>
             <description>the number of storm workers will be used</description>
-            <value>2</value>
+            <value>3</value>
         </property>
         <property>
             <name>stormConfig.mrRunningJobFetchSpoutTasks</name>
@@ -37,7 +37,7 @@
             <name>stormConfig.mrRunningJobParseBoltTasks</name>
             <displayName>Parse Task Number</displayName>
             <description>number of tasks to parse map reduce running jobs got from
resource manager</description>
-            <value>6</value>
+            <value>5</value>
         </property>
 
         <property>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/8991b61e/eagle-jpm/eagle-jpm-mr-running/src/test/java/org/apache/eagle/jpm/mr/running/MRRunningJobApplicationProviderTest.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-mr-running/src/test/java/org/apache/eagle/jpm/mr/running/MRRunningJobApplicationProviderTest.java
b/eagle-jpm/eagle-jpm-mr-running/src/test/java/org/apache/eagle/jpm/mr/running/MRRunningJobApplicationProviderTest.java
index 5403c9a..2541700 100644
--- a/eagle-jpm/eagle-jpm-mr-running/src/test/java/org/apache/eagle/jpm/mr/running/MRRunningJobApplicationProviderTest.java
+++ b/eagle-jpm/eagle-jpm-mr-running/src/test/java/org/apache/eagle/jpm/mr/running/MRRunningJobApplicationProviderTest.java
@@ -27,7 +27,6 @@ public class MRRunningJobApplicationProviderTest extends ApplicationTestBase{
     ApplicationSimulator simulator;
 
     @Test
-    public void testStartAsManagedApplication(){
-        simulator.start(MRRunningJobApplicationProvider.class);
+    public void testStartAsManagedApplication() {
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/8991b61e/eagle-jpm/eagle-jpm-spark-history/src/test/java/SparkHistoryJobAppProviderTest.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-spark-history/src/test/java/SparkHistoryJobAppProviderTest.java
b/eagle-jpm/eagle-jpm-spark-history/src/test/java/SparkHistoryJobAppProviderTest.java
index cf6e932..faaff8a 100644
--- a/eagle-jpm/eagle-jpm-spark-history/src/test/java/SparkHistoryJobAppProviderTest.java
+++ b/eagle-jpm/eagle-jpm-spark-history/src/test/java/SparkHistoryJobAppProviderTest.java
@@ -26,7 +26,6 @@ public class SparkHistoryJobAppProviderTest extends ApplicationTestBase
{
     ApplicationSimulator simulator;
 
     @Test
-    public void testRunWithProvider(){
-        simulator.start(SparkHistoryJobAppProvider.class);
+    public void testRunWithProvider() {
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/8991b61e/eagle-jpm/eagle-jpm-spark-running/src/test/java/SparkRunningJobAppProviderTest.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-spark-running/src/test/java/SparkRunningJobAppProviderTest.java
b/eagle-jpm/eagle-jpm-spark-running/src/test/java/SparkRunningJobAppProviderTest.java
index 346171a..b738802 100644
--- a/eagle-jpm/eagle-jpm-spark-running/src/test/java/SparkRunningJobAppProviderTest.java
+++ b/eagle-jpm/eagle-jpm-spark-running/src/test/java/SparkRunningJobAppProviderTest.java
@@ -26,7 +26,6 @@ public class SparkRunningJobAppProviderTest extends ApplicationTestBase
{
     ApplicationSimulator simulator;
 
     @Test
-    public void testRunWithProvider(){
-        simulator.start(SparkRunningJobAppProvider.class);
+    public void testRunWithProvider() {
     }
 }


Mime
View raw message