diff options
author | Morten Tokle <mortent@verizonmedia.com> | 2021-11-25 23:52:52 +0100 |
---|---|---|
committer | Morten Tokle <mortent@verizonmedia.com> | 2021-11-26 09:38:10 +0100 |
commit | 65267c31e3214faa33f3811f67d55e6c5c2066ef (patch) | |
tree | 6fc27b45502a999e90282c287e746026b6f7d4a0 /config-model-api | |
parent | 8485d1312a9765aeb708c0b6407370eab6c24d47 (diff) |
Support container endpoint weights
Diffstat (limited to 'config-model-api')
-rw-r--r-- | config-model-api/src/main/java/com/yahoo/config/model/api/ContainerEndpoint.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/config-model-api/src/main/java/com/yahoo/config/model/api/ContainerEndpoint.java b/config-model-api/src/main/java/com/yahoo/config/model/api/ContainerEndpoint.java index a114f9d40ef..cd31eb2a49a 100644 --- a/config-model-api/src/main/java/com/yahoo/config/model/api/ContainerEndpoint.java +++ b/config-model-api/src/main/java/com/yahoo/config/model/api/ContainerEndpoint.java @@ -3,6 +3,9 @@ package com.yahoo.config.model.api; import java.util.List; import java.util.Objects; +import java.util.Optional; +import java.util.OptionalInt; +import java.util.OptionalLong; /** * ContainerEndpoint tracks the service names that a Container Cluster should be @@ -16,11 +19,17 @@ public class ContainerEndpoint { private final String clusterId; private final ApplicationClusterEndpoint.Scope scope; private final List<String> names; + private final OptionalInt weight; public ContainerEndpoint(String clusterId, ApplicationClusterEndpoint.Scope scope, List<String> names) { + this(clusterId, scope, names, OptionalInt.empty()); + } + + public ContainerEndpoint(String clusterId, ApplicationClusterEndpoint.Scope scope, List<String> names, OptionalInt weight) { this.clusterId = Objects.requireNonNull(clusterId); this.scope = Objects.requireNonNull(scope); this.names = List.copyOf(Objects.requireNonNull(names)); + this.weight = weight; } public String clusterId() { @@ -35,6 +44,10 @@ public class ContainerEndpoint { return scope; } + public OptionalInt weight() { + return weight; + } + @Override public boolean equals(Object o) { if (this == o) return true; |