summaryrefslogtreecommitdiffstats
path: root/config-provisioning
diff options
context:
space:
mode:
authorValerij Fredriksen <valerij92@gmail.com>2020-10-12 22:57:20 +0200
committerValerij Fredriksen <valerijf@verizonmedia.com>2020-10-13 16:00:50 +0200
commite0bcae50ddc076b6504c16a9c9b54cf593b73944 (patch)
tree779300bf1224112b23822e52904ab664ed82a660 /config-provisioning
parent1fb76b9e6dc6028f2678c1c01054f4d37bec6a04 (diff)
Do internal restart if provisioner is set
Diffstat (limited to 'config-provisioning')
-rw-r--r--config-provisioning/src/main/java/com/yahoo/config/provision/HostFilter.java35
1 files changed, 26 insertions, 9 deletions
diff --git a/config-provisioning/src/main/java/com/yahoo/config/provision/HostFilter.java b/config-provisioning/src/main/java/com/yahoo/config/provision/HostFilter.java
index 95eec2ac0fb..ab84be4b66b 100644
--- a/config-provisioning/src/main/java/com/yahoo/config/provision/HostFilter.java
+++ b/config-provisioning/src/main/java/com/yahoo/config/provision/HostFilter.java
@@ -27,15 +27,11 @@ public class HostFilter {
Set<String> flavors,
Set<ClusterSpec.Type> clusterTypes,
Set<ClusterSpec.Id> clusterIds) {
- Objects.requireNonNull(hostnames, "Hostnames cannot be null, use an empty list");
- Objects.requireNonNull(flavors, "Flavors cannot be null, use an empty list");
- Objects.requireNonNull(clusterTypes, "clusterTypes cannot be null, use an empty list");
- Objects.requireNonNull(clusterIds, "clusterIds cannot be null, use an empty list");
-
- this.hostnames = hostnames;
- this.flavors = flavors;
- this.clusterTypes = clusterTypes;
- this.clusterIds = clusterIds;
+ this.hostnames = Objects.requireNonNull(hostnames, "Hostnames cannot be null, use an empty list");
+ this.flavors = Objects.requireNonNull(flavors, "Flavors cannot be null, use an empty list");
+ this.clusterTypes = Objects.requireNonNull(clusterTypes, "clusterTypes cannot be null, use an empty list");
+ this.clusterIds = Objects.requireNonNull(clusterIds, "clusterIds cannot be null, use an empty list");
+ System.out.println(hostnames);
}
/** Returns true if this filter matches the given host properties */
@@ -92,4 +88,25 @@ public class HostFilter {
StringUtilities.split(clusterIds).stream().map(ClusterSpec.Id::from).collect(Collectors.toSet()));
}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ HostFilter that = (HostFilter) o;
+
+ if (!hostnames.equals(that.hostnames)) return false;
+ if (!flavors.equals(that.flavors)) return false;
+ if (!clusterTypes.equals(that.clusterTypes)) return false;
+ return clusterIds.equals(that.clusterIds);
+ }
+
+ @Override
+ public int hashCode() {
+ int result = hostnames.hashCode();
+ result = 31 * result + flavors.hashCode();
+ result = 31 * result + clusterTypes.hashCode();
+ result = 31 * result + clusterIds.hashCode();
+ return result;
+ }
}