You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by be...@apache.org on 2017/10/31 14:44:12 UTC
ambari git commit: AMBARI-22325 Save/Retrieve v2 blueprints fix:
service ids stored in set in blueprint (benyoka)
Repository: ambari
Updated Branches:
refs/heads/branch-feature-AMBARI-14714 6837c1964 -> eaeed81e5
AMBARI-22325 Save/Retrieve v2 blueprints fix: service ids stored in set in blueprint (benyoka)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/eaeed81e
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/eaeed81e
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/eaeed81e
Branch: refs/heads/branch-feature-AMBARI-14714
Commit: eaeed81e560223ede5218efb630bb59697f6a805
Parents: 6837c19
Author: Balazs Bence Sari <be...@apache.org>
Authored: Tue Oct 31 15:43:48 2017 +0100
Committer: Balazs Bence Sari <be...@apache.org>
Committed: Tue Oct 31 15:44:01 2017 +0100
----------------------------------------------------------------------
.../org/apache/ambari/server/topology/HostGroupV2Impl.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/eaeed81e/ambari-server/src/main/java/org/apache/ambari/server/topology/HostGroupV2Impl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/HostGroupV2Impl.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/HostGroupV2Impl.java
index 2c9d1dd..01f34da 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/topology/HostGroupV2Impl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/HostGroupV2Impl.java
@@ -20,6 +20,7 @@ package org.apache.ambari.server.topology;
import java.util.Collection;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.stream.Collectors;
import javax.annotation.Nullable;
@@ -32,7 +33,6 @@ import com.google.common.base.Preconditions;
import com.google.common.base.Predicates;
import com.google.common.collect.Collections2;
import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
public class HostGroupV2Impl implements HostGroupV2, Configurable {
@@ -40,7 +40,7 @@ public class HostGroupV2Impl implements HostGroupV2, Configurable {
private String name;
private String blueprintName;
private List<ComponentV2> components;
- private List<ServiceId> serviceIds;
+ private Set<ServiceId> serviceIds;
private Configuration configuration;
private String cardinality;
private boolean containsMasterComponent;
@@ -128,7 +128,7 @@ public class HostGroupV2Impl implements HostGroupV2, Configurable {
@JsonIgnore
public void setServiceMap(Map<ServiceId, Service> serviceMap) {
- Preconditions.checkArgument(serviceMap.keySet().equals(ImmutableSet.copyOf(this.serviceIds)),
+ Preconditions.checkArgument(serviceMap.keySet().equals(this.serviceIds),
"Maitained list of service ids doesn't match with received service map: %s vs %s", serviceIds, serviceMap.keySet());
this.serviceMap = serviceMap;
}
@@ -154,7 +154,7 @@ public class HostGroupV2Impl implements HostGroupV2, Configurable {
public void setComponents(List<ComponentV2> components) {
this.components = components;
this.containsMasterComponent = components.stream().anyMatch(c -> c.isMasterComponent());
- this.serviceIds = components.stream().map(c -> c.getServiceId()).collect(Collectors.toList());
+ this.serviceIds = components.stream().map(c -> c.getServiceId()).collect(Collectors.toSet());
}
public void setConfiguration(Configuration configuration) {