You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eagle.apache.org by mw...@apache.org on 2016/07/25 09:36:45 UTC

[08/47] incubator-eagle git commit: Add configuration value to enable application Manager

Add configuration value to enable application Manager


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

Branch: refs/heads/master
Commit: 02fcb79d7dcb959338547bec280cff1991b33cdb
Parents: d8be43f
Author: Zhao, Qingwen <qi...@ebay.com>
Authored: Fri May 6 11:21:48 2016 +0800
Committer: Zhao, Qingwen <qi...@ebay.com>
Committed: Fri May 6 11:21:48 2016 +0800

----------------------------------------------------------------------
 eagle-assembly/src/main/conf/eagle-scheduler.conf            | 1 +
 .../eagle/service/application/AppManagerConstants.java       | 1 +
 .../security/profile/ApplicationSchedulerListener.java       | 8 ++++++--
 eagle-webservice/src/main/resources/eagle-scheduler.conf     | 1 +
 4 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/02fcb79d/eagle-assembly/src/main/conf/eagle-scheduler.conf
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/conf/eagle-scheduler.conf b/eagle-assembly/src/main/conf/eagle-scheduler.conf
index aaab131..74ff18b 100644
--- a/eagle-assembly/src/main/conf/eagle-scheduler.conf
+++ b/eagle-assembly/src/main/conf/eagle-scheduler.conf
@@ -15,6 +15,7 @@
 
 
 ### scheduler propertise
+appCommandLoaderEnabled = false
 appCommandLoaderIntervalSecs = 1
 appHealthCheckIntervalSecs = 5
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/02fcb79d/eagle-core/eagle-application-management/eagle-application-service/src/main/java/org/apache/eagle/service/application/AppManagerConstants.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-application-management/eagle-application-service/src/main/java/org/apache/eagle/service/application/AppManagerConstants.java b/eagle-core/eagle-application-management/eagle-application-service/src/main/java/org/apache/eagle/service/application/AppManagerConstants.java
index dafd7fb..3aa3579 100644
--- a/eagle-core/eagle-application-management/eagle-application-service/src/main/java/org/apache/eagle/service/application/AppManagerConstants.java
+++ b/eagle-core/eagle-application-management/eagle-application-service/src/main/java/org/apache/eagle/service/application/AppManagerConstants.java
@@ -36,6 +36,7 @@ public class AppManagerConstants {
     public final static String EAGLE_CLUSTER_STORM = "storm";
     public final static String EAGLE_CLUSTER_SPARK = "spark";
 
+    public final static String APP_COMMAND_LOADER_ENABLED = "appCommandLoaderEnabled";
     public final static String APP_COMMAND_LOADER_INTERVAL_SECS = "appCommandLoaderIntervalSecs";
     public final static String APP_HEALTH_CHECK_INTERVAL_SECS = "appHealthCheckIntervalSecs";
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/02fcb79d/eagle-webservice/src/main/java/org/apache/eagle/service/security/profile/ApplicationSchedulerListener.java
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/java/org/apache/eagle/service/security/profile/ApplicationSchedulerListener.java b/eagle-webservice/src/main/java/org/apache/eagle/service/security/profile/ApplicationSchedulerListener.java
index a225192..3ef9756 100644
--- a/eagle-webservice/src/main/java/org/apache/eagle/service/security/profile/ApplicationSchedulerListener.java
+++ b/eagle-webservice/src/main/java/org/apache/eagle/service/security/profile/ApplicationSchedulerListener.java
@@ -22,7 +22,9 @@ package org.apache.eagle.service.security.profile;
 import akka.actor.ActorSystem;
 import com.typesafe.config.Config;
 import com.typesafe.config.ConfigFactory;
+import org.apache.eagle.service.application.AppManagerConstants;
 import org.apache.eagle.stream.application.scheduler.ApplicationScheduler;
+import org.apache.hadoop.yarn.api.ApplicationConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import scala.concurrent.duration.Duration;
@@ -42,7 +44,9 @@ public class ApplicationSchedulerListener implements ServletContextListener {
         //Get the actor system from the spring context
         //SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
         Config config = ConfigFactory.load("eagle-scheduler.conf");
-        system = new ApplicationScheduler().start(config);
+        if(config.hasPath(AppManagerConstants.APP_COMMAND_LOADER_ENABLED) && config.getBoolean(AppManagerConstants.APP_COMMAND_LOADER_ENABLED)) {
+            system = new ApplicationScheduler().start(config);
+        }
     }
 
     @Override
@@ -52,7 +56,7 @@ public class ApplicationSchedulerListener implements ServletContextListener {
             system.shutdown();
             system.awaitTermination(Duration.create(15, TimeUnit.SECONDS));
         } else {
-            LOG.warn("No actor system loaded, yet trying to shut down. Check AppContext config and consider if you need this listener.");
+            LOG.warn("No actor system loaded, yet trying to shut down. Check eagle-scheduler.conf and consider if you need this listener.");
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/02fcb79d/eagle-webservice/src/main/resources/eagle-scheduler.conf
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/resources/eagle-scheduler.conf b/eagle-webservice/src/main/resources/eagle-scheduler.conf
index aaab131..74ff18b 100644
--- a/eagle-webservice/src/main/resources/eagle-scheduler.conf
+++ b/eagle-webservice/src/main/resources/eagle-scheduler.conf
@@ -15,6 +15,7 @@
 
 
 ### scheduler propertise
+appCommandLoaderEnabled = false
 appCommandLoaderIntervalSecs = 1
 appHealthCheckIntervalSecs = 5