You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@slider.apache.org by te...@apache.org on 2014/07/16 21:45:42 UTC

git commit: SLIDER-242 exportGroups retrieval can be lifted outside nested loop in AgentProviderService#processReturnedStatus()

Repository: incubator-slider
Updated Branches:
  refs/heads/develop f5282e47c -> 57098509c


SLIDER-242 exportGroups retrieval can be lifted outside nested loop in AgentProviderService#processReturnedStatus()


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

Branch: refs/heads/develop
Commit: 57098509c5888372cf099212384dd4f7263db664
Parents: f5282e4
Author: tedyu <yu...@gmail.com>
Authored: Wed Jul 16 12:45:30 2014 -0700
Committer: tedyu <yu...@gmail.com>
Committed: Wed Jul 16 12:45:30 2014 -0700

----------------------------------------------------------------------
 .../apache/slider/providers/agent/AgentProviderService.java  | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/57098509/slider-core/src/main/java/org/apache/slider/providers/agent/AgentProviderService.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/providers/agent/AgentProviderService.java b/slider-core/src/main/java/org/apache/slider/providers/agent/AgentProviderService.java
index c1719b7..1597b33 100644
--- a/slider-core/src/main/java/org/apache/slider/providers/agent/AgentProviderService.java
+++ b/slider-core/src/main/java/org/apache/slider/providers/agent/AgentProviderService.java
@@ -572,6 +572,9 @@ public class AgentProviderService extends AbstractProviderService implements
     List<ComponentStatus> statuses = heartBeat.getComponentStatus();
     if (statuses != null && !statuses.isEmpty()) {
       log.info("Processing {} status reports.", statuses.size());
+      Application application = getMetainfo().getApplication();
+      List<ExportGroup> exportGroups = application.getExportGroups();
+      boolean hasExportGroups = exportGroups != null && !exportGroups.isEmpty();
       for (ComponentStatus status : statuses) {
         log.info("Status report: " + status.toString());
         if (status.getConfigs() != null) {
@@ -580,10 +583,7 @@ public class AgentProviderService extends AbstractProviderService implements
             publishComponentConfiguration(key, key, configs.entrySet());
           }
 
-          Application application = getMetainfo().getApplication();
-          List<ExportGroup> exportGroups = application.getExportGroups();
-          if (exportGroups != null && !exportGroups.isEmpty()) {
-
+          if (hasExportGroups) {
             String configKeyFormat = "${site.%s.%s}";
             String hostKeyFormat = "${%s_HOST}";