You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sw...@apache.org on 2017/11/27 08:40:14 UTC
ambari git commit: AMBARI-22517. NPE during Ambari schema upgrade
while updating Hive configs.
Repository: ambari
Updated Branches:
refs/heads/branch-2.6 5fab8ff3d -> c6825e913
AMBARI-22517. NPE during Ambari schema upgrade while updating Hive configs.
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c6825e91
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c6825e91
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c6825e91
Branch: refs/heads/branch-2.6
Commit: c6825e913b7f0421b88c8753d73ead0025c6031c
Parents: 5fab8ff
Author: Swapan Shridhar <ss...@hortonworks.com>
Authored: Mon Nov 27 00:07:15 2017 -0800
Committer: Swapan Shridhar <ss...@hortonworks.com>
Committed: Mon Nov 27 00:40:13 2017 -0800
----------------------------------------------------------------------
.../server/upgrade/UpgradeCatalog260.java | 38 ++++++++++----------
1 file changed, 20 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/c6825e91/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
index 5831565..35f9f65 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
@@ -775,26 +775,28 @@ public class UpgradeCatalog260 extends AbstractUpgradeCatalog {
// hive-interactive-site/hive.llap.zk.sm.keytab.file and hive-interactive-site/hive.llap.task.keytab.file respectively,
// based on what hive-interactive-site/hive.llap.daemon.keytab.file has.
Config hsiSiteConfig = cluster.getDesiredConfigByType(HIVE_INTERACTIVE_SITE);
- Map<String, String> hsiSiteConfigProperties = hsiSiteConfig.getProperties();
- if (hsiSiteConfigProperties != null &&
- hsiSiteConfigProperties.containsKey(HIVE_LLAP_DAEMON_KEYTAB_FILE)) {
- String[] identities = {HIVE_LLAP_ZK_SM_KEYTAB_FILE, HIVE_LLAP_TASK_KEYTAB_FILE};
- Map<String, String> newProperties = new HashMap<>();
- for (String identity : identities) {
- // Update only if we were able to modify the corresponding kerberos descriptor,
- // reflected in list 'getYarnKerberosDescUpdatedList'.
- if (getYarnKerberosDescUpdatedList().contains(identity) && hsiSiteConfigProperties.containsKey(identity)) {
- newProperties.put(identity, hsiSiteConfigProperties.get(HIVE_LLAP_DAEMON_KEYTAB_FILE));
+ if (hsiSiteConfig != null) {
+ Map<String, String> hsiSiteConfigProperties = hsiSiteConfig.getProperties();
+ if (hsiSiteConfigProperties != null &&
+ hsiSiteConfigProperties.containsKey(HIVE_LLAP_DAEMON_KEYTAB_FILE)) {
+ String[] identities = {HIVE_LLAP_ZK_SM_KEYTAB_FILE, HIVE_LLAP_TASK_KEYTAB_FILE};
+ Map<String, String> newProperties = new HashMap<>();
+ for (String identity : identities) {
+ // Update only if we were able to modify the corresponding kerberos descriptor,
+ // reflected in list 'getYarnKerberosDescUpdatedList'.
+ if (getYarnKerberosDescUpdatedList().contains(identity) && hsiSiteConfigProperties.containsKey(identity)) {
+ newProperties.put(identity, hsiSiteConfigProperties.get(HIVE_LLAP_DAEMON_KEYTAB_FILE));
+ }
}
- }
- // Update step.
- if (newProperties.size() > 0) {
- try {
- updateConfigurationPropertiesForCluster(cluster, HIVE_INTERACTIVE_SITE, newProperties, true, false);
- LOG.info("Updated HSI config(s) : " + newProperties.keySet() + " with value(s) = " + newProperties.values()+" respectively.");
- } catch (AmbariException e) {
- e.printStackTrace();
+ // Update step.
+ if (newProperties.size() > 0) {
+ try {
+ updateConfigurationPropertiesForCluster(cluster, HIVE_INTERACTIVE_SITE, newProperties, true, false);
+ LOG.info("Updated HSI config(s) : " + newProperties.keySet() + " with value(s) = " + newProperties.values() + " respectively.");
+ } catch (AmbariException e) {
+ e.printStackTrace();
+ }
}
}
}