aboutsummaryrefslogtreecommitdiffstats
path: root/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeList.java
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2023-02-16 11:13:06 +0100
committerMartin Polden <mpolden@mpolden.no>2023-03-13 09:38:19 +0100
commit0149f8fa5a6cc788a1c522e16d86f3fdb3a0c3c0 (patch)
treeae6de80b68b19f3beaa5459a72d306f1c59f340c /node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeList.java
parentf3f818f76dfa230ea31ec0e0b0fe72e1c29123d3 (diff)
Convert IP classes to records
Diffstat (limited to 'node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeList.java')
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeList.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeList.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeList.java
index 62b60858b3f..1cf7bcfa4f2 100644
--- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeList.java
+++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeList.java
@@ -9,7 +9,6 @@ import com.yahoo.config.provision.ClusterSpec;
import com.yahoo.config.provision.NodeResources;
import com.yahoo.config.provision.NodeType;
import com.yahoo.vespa.hosted.provision.node.ClusterId;
-import com.yahoo.vespa.hosted.provision.node.IP;
import java.util.ArrayList;
import java.util.Comparator;
@@ -330,12 +329,12 @@ public class NodeList extends AbstractFilteringList<Node, NodeList> {
/**
* Returns the number of unused IP addresses in the pool, assuming any and all unaccounted for hostnames
- * in the pool are resolved to exactly 1 IP address (or 2 with {@link IP.IpAddresses.Protocol#dualStack}).
+ * in the pool are resolved to exactly 1 IP address (or 2 if dual-stack).
*/
public int eventuallyUnusedIpAddressCount(Node host) {
// The count in this method relies on the size of the IP address pool if that's non-empty,
// otherwise fall back to the address/hostname pool.
- if (host.ipConfig().pool().ipSet().isEmpty()) {
+ if (host.ipConfig().pool().asSet().isEmpty()) {
Set<String> allHostnames = cache().keySet();
return (int) host.ipConfig().pool().hostnames().stream()
.filter(hostname -> !allHostnames.contains(hostname.value()))
@@ -345,7 +344,7 @@ public class NodeList extends AbstractFilteringList<Node, NodeList> {
old != null ? old : stream().flatMap(node -> node.ipConfig().primary().stream())
.collect(Collectors.toUnmodifiableSet())
);
- return (int) host.ipConfig().pool().ipSet().stream()
+ return (int) host.ipConfig().pool().asSet().stream()
.filter(address -> !allIps.contains(address))
.count();
}