aboutsummaryrefslogtreecommitdiffstats
path: root/config-model-api/src/main/java/com/yahoo/config/model/api/Provisioned.java
diff options
context:
space:
mode:
Diffstat (limited to 'config-model-api/src/main/java/com/yahoo/config/model/api/Provisioned.java')
-rw-r--r--config-model-api/src/main/java/com/yahoo/config/model/api/Provisioned.java21
1 files changed, 18 insertions, 3 deletions
diff --git a/config-model-api/src/main/java/com/yahoo/config/model/api/Provisioned.java b/config-model-api/src/main/java/com/yahoo/config/model/api/Provisioned.java
index db0822c4c10..81e0cb58c7d 100644
--- a/config-model-api/src/main/java/com/yahoo/config/model/api/Provisioned.java
+++ b/config-model-api/src/main/java/com/yahoo/config/model/api/Provisioned.java
@@ -16,13 +16,28 @@ import java.util.Map;
*/
public class Provisioned {
- private final Map<ClusterSpec.Id, Capacity> provisioned = new HashMap<>();
+ private final Map<ClusterSpec.Id, ClusterSpec> clusters = new HashMap<>();
+ private final Map<ClusterSpec.Id, Capacity> capacities = new HashMap<>();
+
+ public void add(ClusterSpec cluster, Capacity capacity) {
+ clusters.put(cluster.id(), cluster);
+ capacities.put(cluster.id(), capacity);
+ }
+
+ /** Returns an unmodifiable map of all the cluster requests recorded during build of the model this belongs to */
+ public Map<ClusterSpec.Id, ClusterSpec> clusters() { return Collections.unmodifiableMap(clusters); }
+
+ /** Returns an unmodifiable map of all the capacity provision requests recorded during build of the model this belongs to */
+ public Map<ClusterSpec.Id, Capacity> capacities() { return Collections.unmodifiableMap(capacities); }
+
+ // TODO: Remove after June 2024
public void add(ClusterSpec.Id id, Capacity capacity) {
- provisioned.put(id, capacity);
+ capacities.put(id, capacity);
}
/** Returns an unmodifiable map of all the provision requests recorded during build of the model this belongs to */
- public Map<ClusterSpec.Id, Capacity> all() { return Collections.unmodifiableMap(provisioned); }
+ // TODO: Remove after June 2024
+ public Map<ClusterSpec.Id, Capacity> all() { return Collections.unmodifiableMap(capacities); }
}