You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@slider.apache.org by st...@apache.org on 2015/12/14 19:24:05 UTC

incubator-slider git commit: SLIDER-1023 Configure AM via appconf/components/slider-appmaster slider.* options - fix NPE and add null check

Repository: incubator-slider
Updated Branches:
  refs/heads/develop fe4abc042 -> 9cb966125


SLIDER-1023 Configure AM via appconf/components/slider-appmaster slider.* options - fix NPE and add null check


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

Branch: refs/heads/develop
Commit: 9cb9661252ac90428a7943c495fa4af04bde4491
Parents: fe4abc0
Author: Steve Loughran <st...@apache.org>
Authored: Mon Dec 14 18:23:54 2015 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Mon Dec 14 18:23:54 2015 +0000

----------------------------------------------------------------------
 .../slider/server/appmaster/SliderAppMaster.java  | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/9cb96612/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java b/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java
index 7e75c10..27f6fca 100644
--- a/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java
+++ b/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java
@@ -635,16 +635,18 @@ public class SliderAppMaster extends AbstractSliderLaunchedService
     Configuration serviceConf = getConfig();
 
     // extend AM configuration with component resource
-    MapOperations amConfiguration = getInstanceDefinition()
+    MapOperations amConfiguration = resolvedInstance
       .getAppConfOperations().getComponent(COMPONENT_AM);
     // and patch configuration with prefix
-    Map<String, String> sliderAppConfKeys = amConfiguration.prefixedWith("slider.");
-    for (Map.Entry<String, String> entry : sliderAppConfKeys.entrySet()) {
-      String k = entry.getKey();
-      String v = entry.getValue();
-      boolean exists = serviceConf.get(k) != null;
-      log.info("{} {} to {}", (exists ? "Overwriting" : "Setting"), k, v);
-      serviceConf.set(k, v);
+    if (amConfiguration != null) {
+      Map<String, String> sliderAppConfKeys = amConfiguration.prefixedWith("slider.");
+      for (Map.Entry<String, String> entry : sliderAppConfKeys.entrySet()) {
+        String k = entry.getKey();
+        String v = entry.getValue();
+        boolean exists = serviceConf.get(k) != null;
+        log.info("{} {} to {}", (exists ? "Overwriting" : "Setting"), k, v);
+        serviceConf.set(k, v);
+      }
     }
 
     securityConfiguration = new SecurityConfiguration(serviceConf, resolvedInstance, clustername);