You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sm...@apache.org on 2015/08/27 03:04:53 UTC
ambari git commit: Revert "AMBARI-12811: Disable old APIs to manage
baseurl values (Nahappan Somasundaram via jluniya)"
Repository: ambari
Updated Branches:
refs/heads/trunk 84339970b -> 4c73ea906
Revert "AMBARI-12811: Disable old APIs to manage baseurl values (Nahappan Somasundaram via jluniya)"
This reverts commit bbb042f32d5b7bb3937d6426f16243fd27effb45.
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4c73ea90
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4c73ea90
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4c73ea90
Branch: refs/heads/trunk
Commit: 4c73ea906d02df2c79ef76f5cf6fd2b94ea78ca6
Parents: 8433997
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Wed Aug 26 18:04:36 2015 -0700
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Wed Aug 26 18:04:36 2015 -0700
----------------------------------------------------------------------
ambari-server/conf/unix/ambari.properties | 3 --
.../server/configuration/Configuration.java | 9 -----
.../AmbariManagementControllerImpl.java | 23 ++---------
.../AmbariManagementControllerTest.java | 42 --------------------
4 files changed, 4 insertions(+), 73 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/4c73ea90/ambari-server/conf/unix/ambari.properties
----------------------------------------------------------------------
diff --git a/ambari-server/conf/unix/ambari.properties b/ambari-server/conf/unix/ambari.properties
index 43faa2f..75e0fe1 100644
--- a/ambari-server/conf/unix/ambari.properties
+++ b/ambari-server/conf/unix/ambari.properties
@@ -92,6 +92,3 @@ skip.service.checks=false
rolling.upgrade.min.stack=HDP-2.2
rolling.upgrade.max.stack=
-
-# stack version for deprecating base url in metainfo table
-baseurl.api.metainfo.deprecate.min.version=2.2
http://git-wip-us.apache.org/repos/asf/ambari/blob/4c73ea90/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
index 67fb08e..0b0ee95 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
@@ -438,12 +438,6 @@ public class Configuration {
public static final String ALERTS_EXECUTION_SCHEDULER_THREADS_KEY = "alerts.execution.scheduler.maxThreads";
public static final String ALERTS_EXECUTION_SCHEDULER_THREADS_DEFAULT = "2";
- /**
- * Repository Base URL is no longer stored in metainfo table starting HDP version 2.2. It is in repo_version table.
- */
- public static final String BASEURL_API_DEPRECATED_STACK_VERSION = "baseurl.api.metainfo.deprecate.min.version";
- public static final String BASEURL_API_DEPRECATED_STACK_VERSION_DEFAULT = "2.2";
-
private static final Logger LOG = LoggerFactory.getLogger(
Configuration.class);
@@ -642,9 +636,6 @@ public class Configuration {
configsMap.put(PROXY_ALLOWED_HOST_PORTS, properties.getProperty(
PROXY_ALLOWED_HOST_PORTS, PROXY_ALLOWED_HOST_PORTS_DEFAULT));
- configsMap.put(BASEURL_API_DEPRECATED_STACK_VERSION, properties.getProperty(
- BASEURL_API_DEPRECATED_STACK_VERSION, BASEURL_API_DEPRECATED_STACK_VERSION_DEFAULT));
-
File passFile = new File(configsMap.get(SRVR_KSTR_DIR_KEY) + File.separator
+ configsMap.get(SRVR_CRT_PASS_FILE_KEY));
String password = null;
http://git-wip-us.apache.org/repos/asf/ambari/blob/4c73ea90/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index fe7f369..ef6fc58 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -160,7 +160,6 @@ import org.apache.ambari.server.state.svccomphost.ServiceComponentHostStartEvent
import org.apache.ambari.server.state.svccomphost.ServiceComponentHostStopEvent;
import org.apache.ambari.server.state.svccomphost.ServiceComponentHostUpgradeEvent;
import org.apache.ambari.server.utils.StageUtils;
-import org.apache.ambari.server.utils.VersionUtils;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MultiMap;
import org.apache.commons.io.IOUtils;
@@ -3502,28 +3501,14 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
@Override
public void updateRepositories(Set<RepositoryRequest> requests) throws AmbariException {
for (RepositoryRequest rr : requests) {
- if (null == rr.getStackVersion() || rr.getStackVersion().isEmpty()) {
- throw new AmbariException("Stack version must be specified.");
- }
-
- //
- // If stack version is 2.2.0.0 or greater, error out.
- //
- String stackVersion = rr.getStackVersion();
- String baseUrlDeprecatedStackVersion = configs.getConfigsMap().get(Configuration.BASEURL_API_DEPRECATED_STACK_VERSION);
- try {
- if (VersionUtils.compareVersions(stackVersion, baseUrlDeprecatedStackVersion) >= 0) {
- throw new AmbariException("Stack version (" + stackVersion + ") is not supported");
- }
- }
- catch (NumberFormatException e) {
- throw new AmbariException("Stack version (" + stackVersion + ") is not supported");
- }
-
if (null == rr.getStackName() || rr.getStackName().isEmpty()) {
throw new AmbariException("Stack name must be specified.");
}
+ if (null == rr.getStackVersion() || rr.getStackVersion().isEmpty()) {
+ throw new AmbariException("Stack version must be specified.");
+ }
+
if (null == rr.getOsType() || rr.getOsType().isEmpty()) {
throw new AmbariException("OS type must be specified.");
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/4c73ea90/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
index a2c5a6b..599a1f7 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
@@ -8481,48 +8481,6 @@ public class AmbariManagementControllerTest {
LOG.error("Can not complete test. " + exceptionMsg);
}
- //
- // HDP stack version 2.2 and above are not supported since the base_url information is stored in repo_version table
- //
-
- // Test with stack version 2.2
- requests.clear();
- request = new RepositoryRequest(STACK_NAME, "2.2", OS_TYPE, REPO_ID);
- request.setBaseUrl(baseUrl);
- requests.add(request);
- try {
- controller.updateRepositories(requests);
- } catch (Exception e) {
- String exceptionMsg = e.getMessage();
- assertTrue(exceptionMsg.contains("is not supported"));
- LOG.error("Can not complete test. " + exceptionMsg);
- }
-
- // Test with stack version 2.3 (minor version bumped up)
- requests.clear();
- request = new RepositoryRequest(STACK_NAME, "2.3", OS_TYPE, REPO_ID);
- request.setBaseUrl(baseUrl);
- requests.add(request);
- try {
- controller.updateRepositories(requests);
- } catch (Exception e) {
- String exceptionMsg = e.getMessage();
- assertTrue(exceptionMsg.contains("is not supported"));
- LOG.error("Can not complete test. " + exceptionMsg);
- }
-
- // Test with stack version 3.2 (major version bumped up)
- requests.clear();
- request = new RepositoryRequest(STACK_NAME, "3.2", OS_TYPE, REPO_ID);
- request.setBaseUrl(baseUrl);
- requests.add(request);
- try {
- controller.updateRepositories(requests);
- } catch (Exception e) {
- String exceptionMsg = e.getMessage();
- assertTrue(exceptionMsg.contains("is not supported"));
- LOG.error("Can not complete test. " + exceptionMsg);
- }
}
@Test