diff options
Diffstat (limited to 'clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ContentNodeStatsBuilder.java')
-rw-r--r-- | clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ContentNodeStatsBuilder.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ContentNodeStatsBuilder.java b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ContentNodeStatsBuilder.java new file mode 100644 index 00000000000..088fc018d88 --- /dev/null +++ b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ContentNodeStatsBuilder.java @@ -0,0 +1,27 @@ +package com.yahoo.vespa.clustercontroller.core; + +import java.util.HashMap; +import java.util.Map; + +public class ContentNodeStatsBuilder { + + private final int nodeIndex; + private final Map<String, ContentNodeStats.BucketSpaceStats> stats = new HashMap<>(); + + public ContentNodeStatsBuilder(int nodeIndex) { + this.nodeIndex = nodeIndex; + } + + public ContentNodeStatsBuilder add(String bucketSpace, long bucketsTotal, long bucketsPending) { + return add(bucketSpace, ContentNodeStats.BucketSpaceStats.of(bucketsTotal, bucketsPending)); + } + + public ContentNodeStatsBuilder add(String bucketSpace, ContentNodeStats.BucketSpaceStats bucketSpaceStats) { + stats.put(bucketSpace, bucketSpaceStats); + return this; + } + + public ContentNodeStats build() { + return new ContentNodeStats(nodeIndex, stats); + } +} |