From f1e06c49e55de92d407819736d2844faae078278 Mon Sep 17 00:00:00 2001 From: Morten Tokle Date: Mon, 29 Nov 2021 07:59:25 +0100 Subject: Revert "Revert "read routingmethod"" --- .../config/model/api/ApplicationClusterEndpoint.java | 5 +++++ .../com/yahoo/config/model/api/ContainerEndpoint.java | 19 +++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) (limited to 'config-model-api') 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 names; private final OptionalInt weight; + private final ApplicationClusterEndpoint.RoutingMethod routingMethod; public ContainerEndpoint(String clusterId, ApplicationClusterEndpoint.Scope scope, List names) { this(clusterId, scope, names, OptionalInt.empty()); } public ContainerEndpoint(String clusterId, ApplicationClusterEndpoint.Scope scope, List names, OptionalInt weight) { + this(clusterId, scope, names, weight, ApplicationClusterEndpoint.RoutingMethod.sharedLayer4); + } + + public ContainerEndpoint(String clusterId, ApplicationClusterEndpoint.Scope scope, List 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); } - } -- cgit v1.2.3