aboutsummaryrefslogtreecommitdiffstats
path: root/config-model-api
diff options
context:
space:
mode:
authorMorten Tokle <mortent@verizonmedia.com>2021-11-26 14:44:45 +0100
committerMorten Tokle <mortent@verizonmedia.com>2021-11-26 14:44:45 +0100
commit693fc5f9ec179eb0d4b7b3cb749aff15403c0c75 (patch)
tree7666151e2af47b2149d3f2f80b8da749390a939c /config-model-api
parent59850885588f1f4e75a3eaf115da9a3c0d02c9eb (diff)
Use routingMethod from controller
Diffstat (limited to 'config-model-api')
-rw-r--r--config-model-api/src/main/java/com/yahoo/config/model/api/ApplicationClusterEndpoint.java5
-rw-r--r--config-model-api/src/main/java/com/yahoo/config/model/api/ContainerEndpoint.java19
2 files changed, 20 insertions, 4 deletions
diff --git a/config-model-api/src/main/java/com/yahoo/config/model/api/ApplicationClusterEndpoint.java b/config-model-api/src/main/java/com/yahoo/config/model/api/ApplicationClusterEndpoint.java
index f6583468322..10effd47707 100644
--- a/config-model-api/src/main/java/com/yahoo/config/model/api/ApplicationClusterEndpoint.java
+++ b/config-model-api/src/main/java/com/yahoo/config/model/api/ApplicationClusterEndpoint.java
@@ -112,6 +112,11 @@ public class ApplicationClusterEndpoint {
return this;
}
+ public Builder routingMethod(RoutingMethod routingMethod) {
+ this.routingMethod = routingMethod;
+ return this;
+ }
+
public Builder weight(int weigth) {
this.weigth = weigth;
return this;
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 cd31eb2a49a..78da750fb5b 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
@@ -20,16 +20,22 @@ public class ContainerEndpoint {
private final ApplicationClusterEndpoint.Scope scope;
private final List<String> names;
private final OptionalInt weight;
+ private final ApplicationClusterEndpoint.RoutingMethod routingMethod;
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, scope, names, weight, ApplicationClusterEndpoint.RoutingMethod.sharedLayer4);
+ }
+
+ public ContainerEndpoint(String clusterId, ApplicationClusterEndpoint.Scope scope, List<String> names, OptionalInt weight, ApplicationClusterEndpoint.RoutingMethod routingMethod) {
this.clusterId = Objects.requireNonNull(clusterId);
this.scope = Objects.requireNonNull(scope);
this.names = List.copyOf(Objects.requireNonNull(names));
this.weight = weight;
+ this.routingMethod = routingMethod;
}
public String clusterId() {
@@ -48,6 +54,10 @@ public class ContainerEndpoint {
return weight;
}
+ public ApplicationClusterEndpoint.RoutingMethod routingMethod() {
+ return routingMethod;
+ }
+
@Override
public boolean equals(Object o) {
if (this == o) return true;
@@ -55,17 +65,18 @@ public class ContainerEndpoint {
ContainerEndpoint that = (ContainerEndpoint) o;
return Objects.equals(clusterId, that.clusterId) &&
Objects.equals(scope, that.scope) &&
- Objects.equals(names, that.names);
+ Objects.equals(names, that.names) &&
+ Objects.equals(weight, that.weight) &&
+ Objects.equals(routingMethod, that.routingMethod);
}
@Override
public int hashCode() {
- return Objects.hash(clusterId, names, scope);
+ return Objects.hash(clusterId, names, scope, weight, routingMethod);
}
@Override
public String toString() {
- return String.format("container endpoint %s -> %s [scope=%s]", clusterId, names, scope);
+ return String.format("container endpoint %s -> %s [scope=%s, weight=%s, routingMetod=%s]", clusterId, names, scope, weight, routingMethod);
}
-
}