diff options
author | Jon Bratseth <bratseth@gmail.com> | 2021-04-20 12:50:43 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2021-04-20 12:50:43 +0200 |
commit | e9855a5c0af19b967de1f111963cfe3e8adb6a47 (patch) | |
tree | 9f25f838c190d7a8ec7ffccf9117aa4d9f0eedf7 /config-model | |
parent | 901237f0a48223b8971c56c95e0d7b41e3974d33 (diff) |
No functional changes
Diffstat (limited to 'config-model')
-rw-r--r-- | config-model/src/main/java/com/yahoo/vespa/model/content/StorageGroup.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/StorageGroup.java b/config-model/src/main/java/com/yahoo/vespa/model/content/StorageGroup.java index 3c0f8996c22..fc4fddceb66 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/content/StorageGroup.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/content/StorageGroup.java @@ -143,10 +143,10 @@ public class StorageGroup { } public int getNumberOfLeafGroups() { - int count = subgroups.isEmpty() ? 1 : 0; - for (StorageGroup g : subgroups) { + if (subgroups.isEmpty()) return 1; + int count = 0; + for (StorageGroup g : subgroups) count += g.getNumberOfLeafGroups(); - } return count; } @@ -393,7 +393,8 @@ public class StorageGroup { childAsString(groupElement, VespaDomBuilder.VESPAMALLOC_DEBUG), childAsString(groupElement, VespaDomBuilder.VESPAMALLOC_DEBUG_STACKTRACE)); - List<GroupBuilder> subGroups = groupElement.isPresent() ? collectSubGroups(isHosted, group, groupElement.get()) : Collections.emptyList(); + List<GroupBuilder> subGroups = groupElement.isPresent() ? collectSubGroups(isHosted, group, groupElement.get()) + : List.of(); List<XmlNodeBuilder> explicitNodes = new ArrayList<>(); explicitNodes.addAll(collectExplicitNodes(groupElement)); @@ -407,7 +408,7 @@ public class StorageGroup { nodeRequirement = Optional.of(NodesSpecification.from(nodesElement.get(), context)); else if (nodesElement.isPresent() && context.getDeployState().isHosted() && context.getDeployState().zone().environment().isManuallyDeployed() ) // default to 1 node nodeRequirement = Optional.of(NodesSpecification.from(nodesElement.get(), context)); - else if (! nodesElement.isPresent() && subGroups.isEmpty() && context.getDeployState().isHosted()) // request one node + else if (nodesElement.isEmpty() && subGroups.isEmpty() && context.getDeployState().isHosted()) // request one node nodeRequirement = Optional.of(NodesSpecification.nonDedicated(1, context)); else // Nodes or groups explicitly listed - resolve in GroupBuilder nodeRequirement = Optional.empty(); |