Repository: ambari Updated Branches: refs/heads/trunk e70586842 -> 492497e9f
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/492497e9 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/492497e9 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/492497e9 Branch: refs/heads/trunk Commit: 492497e9f745deab7bc266b63455f9fa5bfff7be Parents: e705868 Author: Andrew Onishuk <[email protected]> Authored: Fri Jul 15 15:13:03 2016 +0300 Committer: Andrew Onishuk <[email protected]> Committed: Fri Jul 15 15:13:03 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/492497e9/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); + } } } }
