ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlun...@apache.org
Subject ambari git commit: Revert "AMBARI-14354: Express Upgrade: Error during preparing Oozie server step during EU from HDP 2.3.0 to 2.3.4 with java.net.UnknownHostException: nameservice error (jluniya)"
Date Sun, 13 Dec 2015 00:56:06 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk f578d42dc -> fd8ffed25


Revert "AMBARI-14354: Express Upgrade: Error during preparing Oozie server step during EU
from HDP 2.3.0 to 2.3.4 with java.net.UnknownHostException: nameservice error (jluniya)"

This reverts commit f578d42dc99a2fc23285d642a8122d6bd00c3284.


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

Branch: refs/heads/trunk
Commit: fd8ffed25dfb6e1a43c872a385b16e663d7b7ca6
Parents: f578d42
Author: Jayush Luniya <jluniya@hortonworks.com>
Authored: Sat Dec 12 16:55:56 2015 -0800
Committer: Jayush Luniya <jluniya@hortonworks.com>
Committed: Sat Dec 12 16:55:56 2015 -0800

----------------------------------------------------------------------
 .../server/upgrade/UpgradeCatalog220.java       | 26 --------
 .../4.0.0.2.0/configuration/oozie-site.xml      |  2 +-
 .../4.2.0.2.3/configuration/oozie-site.xml      |  2 +-
 .../server/upgrade/UpgradeCatalog220Test.java   | 65 +-------------------
 4 files changed, 3 insertions(+), 92 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/fd8ffed2/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog220.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog220.java
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog220.java
index 122cba9..ab0b3cd 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog220.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog220.java
@@ -26,9 +26,6 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.ambari.server.AmbariException;
-import org.apache.ambari.server.controller.AmbariManagementController;
-import org.apache.ambari.server.state.Cluster;
-import org.apache.ambari.server.state.Config;
 import org.apache.ambari.server.orm.DBAccessor.DBColumnInfo;
 import org.apache.ambari.server.orm.dao.DaoUtils;
 import org.apache.ambari.server.orm.dao.PermissionDAO;
@@ -61,11 +58,6 @@ public class UpgradeCatalog220 extends AbstractUpgradeCatalog {
   private static final String ROLE_AUTHORIZATION_ID_COL = "authorization_id";
   private static final String ROLE_AUTHORIZATION_NAME_COL = "authorization_name";
 
-  private static final String OOZIE_SITE_CONFIG = "oozie-site";
-  private static final String OOZIE_SERVICE_HADOOP_CONFIGURATIONS_PROPERTY_NAME = "oozie.service.HadoopAccessorService.hadoop.configurations";
-  private static final String OLD_DEFAULT_HADOOP_CONFIG_PATH = "/etc/hadoop/conf";
-  private static final String NEW_DEFAULT_HADOOP_CONFIG_PATH = "{{hadoop_conf_dir}}";
-
   @Inject
   DaoUtils daoUtils;
 
@@ -135,7 +127,6 @@ public class UpgradeCatalog220 extends AbstractUpgradeCatalog {
     addNewPermissions();
     createRoleAuthorizations();
     createPermissionRoleAuthorizationMap();
-    updateOozieConfigs();
   }
 
   private void addNewPermissions() throws SQLException {
@@ -386,21 +377,4 @@ public class UpgradeCatalog220 extends AbstractUpgradeCatalog {
         PermissionEntity.VIEW_USER_PERMISSION_NAME, PermissionEntity.VIEW_USER_PERMISSION));
   }
 
-  protected void updateOozieConfigs() throws AmbariException {
-    AmbariManagementController ambariManagementController = injector.getInstance(AmbariManagementController.class);
-    for (final Cluster cluster : getCheckedClusterMap(ambariManagementController.getClusters()).values())
{
-      Config oozieSiteProps = cluster.getDesiredConfigByType(OOZIE_SITE_CONFIG);
-      if (oozieSiteProps != null) {
-        // Update oozie.service.HadoopAccessorService.hadoop.configurations
-        Map<String, String> updateProperties = new HashMap<>();
-        String oozieHadoopConfigProperty = oozieSiteProps.getProperties().get(OOZIE_SERVICE_HADOOP_CONFIGURATIONS_PROPERTY_NAME);
-        if(oozieHadoopConfigProperty != null && oozieHadoopConfigProperty.contains(OLD_DEFAULT_HADOOP_CONFIG_PATH))
{
-          String updatedOozieHadoopConfigProperty = oozieHadoopConfigProperty.replaceAll(
-              OLD_DEFAULT_HADOOP_CONFIG_PATH, NEW_DEFAULT_HADOOP_CONFIG_PATH);
-          updateProperties.put(OOZIE_SERVICE_HADOOP_CONFIGURATIONS_PROPERTY_NAME, updatedOozieHadoopConfigProperty);
-          updateConfigurationPropertiesForCluster(cluster, OOZIE_SITE_CONFIG, updateProperties,
true, false);
-        }
-      }
-    }
-  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/fd8ffed2/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/configuration/oozie-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/configuration/oozie-site.xml
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/configuration/oozie-site.xml
index 5a18875..57cc8a7 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/configuration/oozie-site.xml
+++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/configuration/oozie-site.xml
@@ -150,7 +150,7 @@
   </property>
   <property>
     <name>oozie.service.HadoopAccessorService.hadoop.configurations</name>
-    <value>*={{hadoop_conf_dir}}</value>
+    <value>*=/etc/hadoop/conf</value>
     <description>
       Comma separated AUTHORITY=HADOOP_CONF_DIR, where AUTHORITY is the HOST:PORT of
       the Hadoop service (JobTracker, HDFS). The wildcard '*' configuration is

http://git-wip-us.apache.org/repos/asf/ambari/blob/fd8ffed2/ambari-server/src/main/resources/common-services/OOZIE/4.2.0.2.3/configuration/oozie-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.2.0.2.3/configuration/oozie-site.xml
b/ambari-server/src/main/resources/common-services/OOZIE/4.2.0.2.3/configuration/oozie-site.xml
index 079ca25..b25cfcb 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/4.2.0.2.3/configuration/oozie-site.xml
+++ b/ambari-server/src/main/resources/common-services/OOZIE/4.2.0.2.3/configuration/oozie-site.xml
@@ -48,7 +48,7 @@
 
   <property>
     <name>oozie.service.HadoopAccessorService.hadoop.configurations</name>
-    <value>*={{hadoop_conf_dir}}</value>
+    <value>*=/etc/hadoop/conf</value>
     <description>
       Comma separated AUTHORITY=HADOOP_CONF_DIR, where AUTHORITY is the HOST:PORT of
       the Hadoop service (JobTracker, HDFS). The wildcard '*' configuration is

http://git-wip-us.apache.org/repos/asf/ambari/blob/fd8ffed2/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog220Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog220Test.java
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog220Test.java
index a2926a1..5359101 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog220Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog220Test.java
@@ -22,20 +22,15 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
 import java.lang.reflect.Field;
-import java.lang.reflect.Method;
 import java.util.List;
 
 import org.apache.ambari.server.configuration.Configuration;
-import org.apache.ambari.server.controller.AmbariManagementController;
 import org.apache.ambari.server.orm.DBAccessor;
 import org.apache.ambari.server.orm.dao.DaoUtils;
 import org.apache.ambari.server.orm.dao.PermissionDAO;
 import org.apache.ambari.server.orm.dao.ResourceTypeDAO;
 import org.apache.ambari.server.orm.entities.PermissionEntity;
 import org.apache.ambari.server.orm.entities.ResourceTypeEntity;
-import org.apache.ambari.server.state.Cluster;
-import org.apache.ambari.server.state.Clusters;
-import org.apache.ambari.server.state.Config;
 import org.apache.ambari.server.state.stack.OsFamily;
 import org.easymock.Capture;
 import org.easymock.EasyMock;
@@ -44,7 +39,6 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-import com.google.inject.AbstractModule;
 import com.google.inject.Binder;
 import com.google.inject.Guice;
 import com.google.inject.Injector;
@@ -52,17 +46,12 @@ import com.google.inject.Module;
 
 import javax.persistence.EntityManager;
 
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
 /**
  * UpgradeCatalog220 tests.
  */
 public class UpgradeCatalog220Test extends EasyMockSupport {
 
   private Injector injector;
-  private AmbariManagementController controller;
 
   @Before
   public void setup() {
@@ -167,17 +156,8 @@ public class UpgradeCatalog220Test extends EasyMockSupport {
 
   @Test
   public void testExecuteDMLUpdates() throws Exception {
-    Method updateOozieConfigs = UpgradeCatalog220.class.getDeclaredMethod("updateOozieConfigs");
-
     final DBAccessor dbAccessor = injector.getInstance(DBAccessor.class);
-    UpgradeCatalog220 upgradeCatalog = createMockBuilder(UpgradeCatalog220.class)
-        .withConstructor(Injector.class)
-        .withArgs(injector)
-        .addMockedMethod(updateOozieConfigs)
-        .createMock();
-
-    upgradeCatalog.updateOozieConfigs();
-    expectLastCall().once();
+    UpgradeCatalog220 upgradeCatalog = injector.getInstance(UpgradeCatalog220.class);
 
     final ResourceTypeEntity ambariResourceTypeEntity = createMock(ResourceTypeEntity.class);
     expect(ambariResourceTypeEntity.getId()).andReturn(1).anyTimes();
@@ -286,47 +266,4 @@ public class UpgradeCatalog220Test extends EasyMockSupport {
     Assert.assertEquals("2.1.3", upgradeCatalog.getSourceVersion());
   }
 
-  @Test
-  public void testUpdateOozieConfigs() throws Exception {
-    EasyMockSupport easyMockSupport = new EasyMockSupport();
-    final AmbariManagementController mockAmbariManagementController = easyMockSupport.createNiceMock(AmbariManagementController.class);
-    final Clusters mockClusters = easyMockSupport.createStrictMock(Clusters.class);
-    final Cluster mockClusterExpected = easyMockSupport.createNiceMock(Cluster.class);
-    expect(mockAmbariManagementController.getClusters()).andReturn(mockClusters).once();
-    expect(mockClusters.getClusters()).andReturn(new HashMap<String, Cluster>() {{
-      put("normal", mockClusterExpected);
-    }}).atLeastOnce();
-    final Config oozieSiteConf = easyMockSupport.createNiceMock(Config.class);
-    final Map<String, String> propertiesOozieSite = new HashMap<String, String>()
{{
-      put("oozie.service.HadoopAccessorService.hadoop.configurations", "*=/etc/hadoop/conf");
-    }};
-    expect(mockClusterExpected.getDesiredConfigByType("oozie-site")).andReturn(oozieSiteConf).atLeastOnce();
-    expect(oozieSiteConf.getProperties()).andReturn(propertiesOozieSite).once();
-
-    final Injector mockInjector = Guice.createInjector(new AbstractModule() {
-      @Override
-      protected void configure() {
-        bind(AmbariManagementController.class).toInstance(mockAmbariManagementController);
-        bind(Clusters.class).toInstance(mockClusters);
-        bind(DBAccessor.class).toInstance(createNiceMock(DBAccessor.class));
-        bind(OsFamily.class).toInstance(createNiceMock(OsFamily.class));
-      }
-    });
-
-    UpgradeCatalog220 upgradeCatalog220 = createMockBuilder(UpgradeCatalog220.class)
-        .withConstructor(Injector.class)
-        .withArgs(mockInjector)
-        .addMockedMethod("updateConfigurationPropertiesForCluster", Cluster.class, String.class,
-            Map.class, boolean.class, boolean.class)
-        .createMock();
-    upgradeCatalog220.updateConfigurationPropertiesForCluster(mockClusterExpected, "oozie-site",
-        Collections.singletonMap("oozie.service.HadoopAccessorService.hadoop.configurations",
"*={{hadoop_conf_dir}}"),
-        true, false);
-    expectLastCall().once();
-
-    easyMockSupport.replayAll();
-    replay(upgradeCatalog220);
-    upgradeCatalog220.updateOozieConfigs();
-    easyMockSupport.verifyAll();
-  }
 }


Mime
View raw message