AMBARI-22272: HDP + HDF installation fails in Ambari 2.6 - addendum (jluniya)
(cherry picked from commit 2407b5cab7942b3e69b89497279c8f010d5cbc4e) Change-Id: I2104c903fb0411545653daded1d2208462bc565d Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e6c60231 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e6c60231 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e6c60231 Branch: refs/heads/AMBARI-2.6.0.0 Commit: e6c60231734bcce4d8b4481bbcc51915b14d3d21 Parents: 3eee0ad Author: Jayush Luniya <jlun...@hortonworks.com> Authored: Fri Oct 20 14:17:15 2017 -0700 Committer: Jenkins <jenk...@hortonworks.com> Committed: Fri Oct 20 21:39:35 2017 +0000 ---------------------------------------------------------------------- .../java/org/apache/ambari/server/agent/CommandRepository.java | 3 ++- .../src/main/java/org/apache/ambari/server/stack/StackModule.java | 2 +- .../main/java/org/apache/ambari/server/state/RepositoryInfo.java | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/e6c60231/ambari-server/src/main/java/org/apache/ambari/server/agent/CommandRepository.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/agent/CommandRepository.java b/ambari-server/src/main/java/org/apache/ambari/server/agent/CommandRepository.java index b0e6d6f..912e05f 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/agent/CommandRepository.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/agent/CommandRepository.java @@ -25,6 +25,7 @@ import org.apache.ambari.annotations.Experimental; import org.apache.ambari.annotations.ExperimentalFeature; import org.apache.ambari.server.orm.entities.RepositoryEntity; import org.apache.ambari.server.state.RepositoryInfo; +import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.builder.ToStringBuilder; import com.google.gson.annotations.SerializedName; @@ -344,7 +345,7 @@ public class CommandRepository { .append("components", m_components) .append("id", m_repoId) .append("baseUrl", m_baseUrl) - .append("applicableServices", (m_applicableServices != null? String.join(",", m_applicableServices) : "")) + .append("applicableServices", (m_applicableServices != null? StringUtils.join(m_applicableServices, ",") : "")) .toString(); } } http://git-wip-us.apache.org/repos/asf/ambari/blob/e6c60231/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java index d770ac9..0313770 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java @@ -1236,7 +1236,7 @@ public class StackModule extends BaseModule<StackModule, StackInfo> implements V LOG.warn("Discarding service repository with duplicate name and different content: {}", repo); } else { - String key = String.join("-", repo.getOsType(), repo.getRepoName(), repo.getRepoId()); + String key = repo.getOsType() + "-" + repo.getRepoName() + "-" + repo.getRepoId(); if(uniqueServiceRepos.containsKey(key)) { uniqueServiceRepos.get(key).getApplicableServices().addAll(repo.getApplicableServices()); } else { http://git-wip-us.apache.org/repos/asf/ambari/blob/e6c60231/ambari-server/src/main/java/org/apache/ambari/server/state/RepositoryInfo.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/RepositoryInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/state/RepositoryInfo.java index 602d63b..bd53c11 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/RepositoryInfo.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/RepositoryInfo.java @@ -25,6 +25,7 @@ import com.google.common.base.Objects; import org.apache.ambari.annotations.Experimental; import org.apache.ambari.annotations.ExperimentalFeature; import org.apache.ambari.server.controller.RepositoryResponse; +import org.apache.commons.lang.StringUtils; import com.google.common.base.Function; import com.google.common.base.Strings; @@ -198,7 +199,7 @@ public class RepositoryInfo { + ", mirrorsList=" + mirrorsList + ", unique=" + unique + ", ambariManagedRepositories=" + ambariManagedRepositories - + ", applicableServices=" + String.join(",", applicableServices) + + ", applicableServices=" + StringUtils.join(applicableServices, ",") + " ]"; }