aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-04-20 18:09:59 +0200
committerGitHub <noreply@github.com>2022-04-20 18:09:59 +0200
commitd852a539468eb3ea10549caa7238ba66ba60d586 (patch)
tree05b9336af62afbf093fac611a7b8346a111e3f92 /searchlib
parentdb838bbf51864f29c20538be2c6d3c2599c4a3e7 (diff)
parent4fa695edbeb3ecc28c16fc7819ac4d92987f9ef4 (diff)
Merge pull request #22166 from vespa-engine/balder/cheaper-way-to-get-num-children
Cheaper way to get number of children.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/main/java/com/yahoo/searchlib/aggregation/Group.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/searchlib/src/main/java/com/yahoo/searchlib/aggregation/Group.java b/searchlib/src/main/java/com/yahoo/searchlib/aggregation/Group.java
index 0b4a1eb8bbc..4ff3b342a20 100644
--- a/searchlib/src/main/java/com/yahoo/searchlib/aggregation/Group.java
+++ b/searchlib/src/main/java/com/yahoo/searchlib/aggregation/Group.java
@@ -229,11 +229,16 @@ public class Group extends Identifiable {
return this;
}
- /** Returns the list of child groups to this. */
+ /** Returns immutable list of child groups to this. */
public List<Group> getChildren() {
return List.copyOf(children);
}
+ /** Returns number of children groups */
+ public int getNumChildren() {
+ return children.size();
+ }
+
/**
* Returns the tag of this group. This value is set per-level in the grouping request, and then becomes assigned
* to each group of that level in the grouping result as they are copied from the prototype.