You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by lp...@apache.org on 2017/08/29 13:25:13 UTC
[10/50] [abbrv] ambari git commit: AMBARI-21801 - No Hosts are
Targeted For MAINT VDF If Available Services is Empty (jonathanhurley)
AMBARI-21801 - No Hosts are Targeted For MAINT VDF If Available Services is Empty (jonathanhurley)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/76f0dafb
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/76f0dafb
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/76f0dafb
Branch: refs/heads/feature-branch-AMBARI-21307
Commit: 76f0dafbd561f3052bc0d90045fcfdcba93beb3a
Parents: 6063253
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Thu Aug 24 00:08:42 2017 -0400
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Thu Aug 24 12:38:02 2017 -0400
----------------------------------------------------------------------
.../org/apache/ambari/server/state/cluster/ClusterImpl.java | 6 ++++--
.../ambari/server/state/repository/VersionDefinitionXml.java | 2 +-
2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/76f0dafb/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
index 26be06e..3953184 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
@@ -128,6 +128,7 @@ import org.apache.ambari.server.state.UpgradeContextFactory;
import org.apache.ambari.server.state.configgroup.ConfigGroup;
import org.apache.ambari.server.state.configgroup.ConfigGroupFactory;
import org.apache.ambari.server.state.fsm.InvalidStateTransitionException;
+import org.apache.ambari.server.state.repository.ClusterVersionSummary;
import org.apache.ambari.server.state.repository.VersionDefinitionXml;
import org.apache.ambari.server.state.scheduler.RequestExecution;
import org.apache.ambari.server.state.scheduler.RequestExecutionFactory;
@@ -993,12 +994,13 @@ public class ClusterImpl implements Cluster {
// does the host gets a different repo state based on VDF and repo
// type
boolean hostRequiresRepository = false;
- Set<String> servicesInRepository = versionDefinitionXml.getAvailableServiceNames();
+ ClusterVersionSummary clusterSummary = versionDefinitionXml.getClusterSummary(this);
+ Set<String> servicesInUpgrade = clusterSummary.getAvailableServiceNames();
List<ServiceComponentHost> schs = getServiceComponentHosts(hostEntity.getHostName());
for (ServiceComponentHost serviceComponentHost : schs) {
String serviceName = serviceComponentHost.getServiceName();
- if (servicesInRepository.contains(serviceName)) {
+ if (servicesInUpgrade.contains(serviceName)) {
hostRequiresRepository = true;
break;
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/76f0dafb/ambari-server/src/main/java/org/apache/ambari/server/state/repository/VersionDefinitionXml.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/repository/VersionDefinitionXml.java b/ambari-server/src/main/java/org/apache/ambari/server/state/repository/VersionDefinitionXml.java
index 96bf668..ec4814b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/repository/VersionDefinitionXml.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/repository/VersionDefinitionXml.java
@@ -150,7 +150,7 @@ public class VersionDefinitionXml {
* Gets the set of services that are included in this XML
* @return an empty set for STANDARD repositories, or a non-empty set for PATCH type.
*/
- public Set<String> getAvailableServiceNames() {
+ private Set<String> getAvailableServiceNames() {
if (availableServices.isEmpty()) {
return Collections.emptySet();
} else {