aboutsummaryrefslogtreecommitdiffstats
path: root/config-model-api
diff options
context:
space:
mode:
authorMorten Tokle <morten.tokle@gmail.com>2021-11-29 07:59:25 +0100
committerGitHub <noreply@github.com>2021-11-29 07:59:25 +0100
commitf1e06c49e55de92d407819736d2844faae078278 (patch)
tree1df54b8b399543396e56d8276b6606f53cd0fcde /config-model-api
parent59e178e3ac014becaf9b4efc2c38e26564d24626 (diff)
Revert "Revert "read routingmethod""
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);
}
-
}