Repository: ambari Updated Branches: refs/heads/branch-2.4 2d636c97a -> 101d79600
AMBARI-17223. Ability to add "javax.jdo.option.ConnectionPassword" to hive clients from ambari (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/101d7960 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/101d7960 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/101d7960 Branch: refs/heads/branch-2.4 Commit: 101d7960013553c3ea6fe2da9c64286f9ba582b3 Parents: 2d636c9 Author: Andrew Onishuk <[email protected]> Authored: Fri Jul 15 15:12:33 2016 +0300 Committer: Andrew Onishuk <[email protected]> Committed: Fri Jul 15 15:12:33 2016 +0300 ---------------------------------------------------------------------- .../ambari/server/state/ConfigHelper.java | 34 +++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/101d7960/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java index ee9511f..51435fe 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java @@ -1331,22 +1331,24 @@ public class ConfigHelper { public static void processHiddenAttribute(Map<String, Map<String, String>> configurations, Map<String, Map<String, Map<String, String>>> attributes, String componentName, boolean configDownload){ - for(Map.Entry<String, Map<String,String>> confEntry : configurations.entrySet()){ - String configTag = confEntry.getKey(); - Map<String,String> confProperties = confEntry.getValue(); - if(attributes.containsKey(configTag)){ - Map<String, Map<String, String>> configAttributes = attributes.get(configTag); - if(configAttributes.containsKey("hidden")){ - Map<String,String> hiddenProperties = configAttributes.get("hidden"); - if(hiddenProperties != null) { - for (Map.Entry<String, String> hiddenEntry : hiddenProperties.entrySet()) { - String propertyName = hiddenEntry.getKey(); - String components = hiddenEntry.getValue(); - // hide property if we are downloading config & CONFIG_DOWNLOAD defined, - // otherwise - check if we have matching component name - if ((configDownload ? components.contains("CONFIG_DOWNLOAD") : components.contains(componentName)) - && confProperties.containsKey(propertyName)) { - confProperties.remove(propertyName); + if (configurations != null && attributes != null && componentName != null) { + for(Map.Entry<String, Map<String,String>> confEntry : configurations.entrySet()){ + String configTag = confEntry.getKey(); + Map<String,String> confProperties = confEntry.getValue(); + if(attributes.containsKey(configTag)){ + Map<String, Map<String, String>> configAttributes = attributes.get(configTag); + if(configAttributes.containsKey("hidden")){ + Map<String,String> hiddenProperties = configAttributes.get("hidden"); + if(hiddenProperties != null) { + for (Map.Entry<String, String> hiddenEntry : hiddenProperties.entrySet()) { + String propertyName = hiddenEntry.getKey(); + String components = hiddenEntry.getValue(); + // hide property if we are downloading config & CONFIG_DOWNLOAD defined, + // otherwise - check if we have matching component name + if ((configDownload ? components.contains("CONFIG_DOWNLOAD") : components.contains(componentName)) + && confProperties.containsKey(propertyName)) { + confProperties.remove(propertyName); + } } } }
