ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmitriu...@apache.org
Subject ambari git commit: AMBARI-18278. Provide Notes On Service Config Changes During Ambari Upgrade (dlysnichenko)
Date Wed, 07 Sep 2016 11:22:28 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 485d73545 -> 8755bf91e


AMBARI-18278. Provide Notes On Service Config Changes During Ambari Upgrade (dlysnichenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8755bf91
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8755bf91
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8755bf91

Branch: refs/heads/trunk
Commit: 8755bf91e2a728132262669b50713388cf08b8db
Parents: 485d735
Author: Lisnichenko Dmitro <dlysnichenko@hortonworks.com>
Authored: Wed Sep 7 14:21:20 2016 +0300
Committer: Lisnichenko Dmitro <dlysnichenko@hortonworks.com>
Committed: Wed Sep 7 14:21:20 2016 +0300

----------------------------------------------------------------------
 .../ambari/server/upgrade/AbstractUpgradeCatalog.java |  3 ++-
 .../ambari/server/upgrade/UpgradeCatalog210Test.java  | 14 +++++++++-----
 2 files changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8755bf91/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
index 724667d..86633ae 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
@@ -597,7 +597,8 @@ public abstract class AbstractUpgradeCatalog implements UpgradeCatalog
{
           if (baseConfig != null) {
             String authName = AUTHENTICATED_USER_NAME;
 
-            if (cluster.addDesiredConfig(authName, Collections.singleton(baseConfig)) !=
null) {
+            String configVersionNote = String.format("Updated %s during Ambari Upgrade from
%s to %s.", configType, getSourceVersion(), getTargetVersion());
+            if (cluster.addDesiredConfig(authName, Collections.singleton(baseConfig), configVersionNote)
!= null) {
               String oldConfigString = (oldConfig != null) ? " from='" + oldConfig.getTag()
+ "'" : "";
               LOG.info("cluster '" + cluster.getClusterName() + "' "
                 + "changed by: '" + authName + "'; "

http://git-wip-us.apache.org/repos/asf/ambari/blob/8755bf91/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog210Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog210Test.java
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog210Test.java
index e3b5d15..08374da 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog210Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog210Test.java
@@ -303,8 +303,12 @@ public class UpgradeCatalog210Test {
     ServiceConfigVersionResponse r = null;
     expect(mockClusterExpected.getConfig(anyObject(String.class), anyObject(String.class))).
         andReturn(mockHiveServer).anyTimes();
-    expect(mockClusterExpected.addDesiredConfig("ambari-upgrade", Collections.singleton(mockHiveServer))).
-        andReturn(r).times(3);
+    expect(mockClusterExpected.addDesiredConfig("ambari-upgrade", Collections.singleton(mockHiveServer),
"Updated hive-env during Ambari Upgrade from 2.0.0 to 2.1.0.")).
+        andReturn(r).times(1);
+    expect(mockClusterExpected.addDesiredConfig("ambari-upgrade", Collections.singleton(mockHiveServer),
"Updated hiveserver2-site during Ambari Upgrade from 2.0.0 to 2.1.0.")).
+        andReturn(r).times(1);
+    expect(mockClusterExpected.addDesiredConfig("ambari-upgrade", Collections.singleton(mockHiveServer),
"Updated ranger-hive-plugin-properties during Ambari Upgrade from 2.0.0 to 2.1.0.")).
+        andReturn(r).times(1);
 
     easyMockSupport.replayAll();
     mockInjector.getInstance(UpgradeCatalog210.class).updateRangerHiveConfigs();
@@ -364,14 +368,14 @@ public class UpgradeCatalog210Test {
     expect(mockHiveServerSite.getProperties()).andReturn(propertiesExpectedHiveServerSite).anyTimes();
     expect(mockClusterExpected.getConfig(capture(configTypeEnv), anyObject(String.class))).andReturn(mockHiveEnv).once();
     expect(mockClusterExpected.getConfig(capture(configTypeServerSite), anyObject(String.class))).andReturn(mockHiveServerSite).once();
-    expect(mockClusterExpected.addDesiredConfig("ambari-upgrade", Collections.singleton(mockHiveEnv))).andReturn(mockServiceConfigVersionResponse).once();
-    expect(mockClusterExpected.addDesiredConfig("ambari-upgrade", Collections.singleton(mockHiveServerSite))).andReturn(mockServiceConfigVersionResponse).once();
+    expect(mockClusterExpected.addDesiredConfig("ambari-upgrade", Collections.singleton(mockHiveEnv),
"Updated hive-env during Ambari Upgrade from 2.0.0 to 2.1.0.")).andReturn(mockServiceConfigVersionResponse).once();
+    expect(mockClusterExpected.addDesiredConfig("ambari-upgrade", Collections.singleton(mockHiveServerSite),
"Updated hiveserver2-site during Ambari Upgrade from 2.0.0 to 2.1.0.")).andReturn(mockServiceConfigVersionResponse).once();
 
     expect(mockClusterExpected.getDesiredConfigByType("hive-site")).andReturn(mockHiveSite).atLeastOnce();
     expect(mockHiveSite.getProperties()).andReturn(propertiesExpectedHiveSite).anyTimes();
     expect(mockClusterExpected.getServices()).andReturn(servicesExpected).once();
     expect(mockClusterExpected.getConfig(capture(configTypeSite), anyObject(String.class))).andReturn(mockHiveSite).once();
-    expect(mockClusterExpected.addDesiredConfig("ambari-upgrade", Collections.singleton(mockHiveSite))).andReturn(mockServiceConfigVersionResponse).once();
+    expect(mockClusterExpected.addDesiredConfig("ambari-upgrade", Collections.singleton(mockHiveSite),
"Updated hive-site during Ambari Upgrade from 2.0.0 to 2.1.0.")).andReturn(mockServiceConfigVersionResponse).once();
 
     easyMockSupport.replayAll();
     mockInjector.getInstance(UpgradeCatalog210.class).updateHiveConfigs();


Mime
View raw message