You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2017/11/30 14:25:08 UTC
[14/50] [abbrv] ambari git commit: AMBARI-22517. NPE during Ambari
schema upgrade while updating Hive configs.
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/c9936ad3
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c9936ad3
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c9936ad3
Branch: refs/heads/branch-feature-AMBARI-21674
Commit: c9936ad349e3e703dcbf6f2a1644f8a3e45a23d0
Parents: c5fe6cb
Author: Swapan Shridhar <ss...@hortonworks.com>
Authored: Mon Nov 27 00:47:57 2017 -0800
Committer: Swapan Shridhar <ss...@hortonworks.com>
Committed: Mon Nov 27 00:47:57 2017 -0800
----------------------------------------------------------------------
.../server/upgrade/UpgradeCatalog260.java | 38 ++++++++++----------
1 file changed, 20 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9936ad3/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 33b62f8..4d9a5da 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();
+ }
}
}
}