summaryrefslogtreecommitdiffstats
path: root/node-repository/src/main
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2020-05-19 20:07:16 +0200
committerJon Bratseth <bratseth@gmail.com>2020-05-19 20:07:16 +0200
commit7832bca16b1568a0b5481ac472b18f87f92dc123 (patch)
tree3b2422c132d884aab17e3d7772ed60659ce43529 /node-repository/src/main
parent69b3bbee1cd90ec5836d5ef1fd06e80072acd450 (diff)
Add test
Diffstat (limited to 'node-repository/src/main')
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeList.java5
1 files changed, 5 insertions, 0 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 ce696903a53..6097688df72 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
@@ -142,6 +142,11 @@ public class NodeList extends AbstractFilteringList<Node, NodeList> {
.collect(collectingAndThen(Collectors.toList(), NodeList::copyOf));
}
+ public NodeList group(int index) {
+ return matching(n -> ( n.allocation().isPresent() &&
+ n.allocation().get().membership().cluster().group().equals(Optional.of(ClusterSpec.Group.from(index)))));
+ }
+
/** Returns the parent node of the given child node */
public Optional<Node> parentOf(Node child) {
return child.parentHostname()