diff options
author | Martin Polden <mpolden@mpolden.no> | 2022-02-10 10:38:28 +0100 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2022-02-10 10:38:28 +0100 |
commit | a4c0cbf1d44b197616fde4b6ec08f259527f8c0c (patch) | |
tree | c618b1e37b5053471c0004a78441f5263c9737ba /configserver/src/main/java | |
parent | 0b284f194c0b2dc9b1f8b36b489911f32961d840 (diff) |
Remove unused fields from LbServicesConfig
Diffstat (limited to 'configserver/src/main/java')
-rw-r--r-- | configserver/src/main/java/com/yahoo/vespa/config/server/model/LbServicesProducer.java | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/model/LbServicesProducer.java b/configserver/src/main/java/com/yahoo/vespa/config/server/model/LbServicesProducer.java index 69bef89056d..7677417f1a9 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/model/LbServicesProducer.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/model/LbServicesProducer.java @@ -1,7 +1,6 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.config.server.model; -import com.google.common.base.Joiner; import com.yahoo.cloud.config.LbServicesConfig; import com.yahoo.config.model.api.ApplicationClusterEndpoint; import com.yahoo.config.model.api.ApplicationClusterInfo; @@ -11,19 +10,14 @@ import com.yahoo.config.model.api.ServiceInfo; import com.yahoo.config.provision.ApplicationId; import com.yahoo.config.provision.TenantName; import com.yahoo.config.provision.Zone; -import com.yahoo.vespa.flags.BooleanFlag; -import com.yahoo.vespa.flags.FetchVector; import com.yahoo.vespa.flags.FlagSource; -import com.yahoo.vespa.flags.Flags; -import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; -import java.util.stream.Stream; import static com.yahoo.config.model.api.container.ContainerServiceType.CONTAINER; import static com.yahoo.config.model.api.container.ContainerServiceType.QRSERVER; @@ -74,13 +68,6 @@ public class LbServicesProducer implements LbServicesConfig.Producer { // TODO: read active rotation from ApplicationClusterInfo ab.activeRotation(getActiveRotation(app)); - ab.usePowerOfTwoChoicesLb(true); - ab.generateNonMtlsEndpoint(false); - - // TODO: Remove when endpoints-config is read by all load balancers - app.getModel().getHosts().stream() - .sorted((a, b) -> a.getHostname().compareTo(b.getHostname())) - .forEach(hostInfo -> ab.hosts(hostInfo.getHostname(), getHostsConfig(hostInfo))); Set<ApplicationClusterInfo> applicationClusterInfos = app.getModel().applicationClusterInfo(); List<LbServicesConfig.Tenants.Applications.Endpoints.Builder> endpointBuilder = applicationClusterInfos.stream() @@ -121,34 +108,4 @@ public class LbServicesProducer implements LbServicesConfig.Producer { return activeRotation; } - private LbServicesConfig.Tenants.Applications.Hosts.Builder getHostsConfig(HostInfo hostInfo) { - LbServicesConfig.Tenants.Applications.Hosts.Builder hb = new LbServicesConfig.Tenants.Applications.Hosts.Builder(); - hb.hostname(hostInfo.getHostname()); - hostInfo.getServices().forEach(serviceInfo -> hb.services(serviceInfo.getServiceName(), getServiceConfig(serviceInfo))); - return hb; - } - - private LbServicesConfig.Tenants.Applications.Hosts.Services.Builder getServiceConfig(ServiceInfo serviceInfo) { - List<String> endpointAliases = Stream.of(serviceInfo.getProperty("endpointaliases").orElse("").split(",")). - filter(prop -> !"".equals(prop)).collect(Collectors.toList()); - endpointAliases.addAll(Stream.of(serviceInfo.getProperty("rotations").orElse("").split(",")).filter(prop -> !"".equals(prop)).collect(Collectors.toList())); - Collections.sort(endpointAliases); - - LbServicesConfig.Tenants.Applications.Hosts.Services.Builder sb = new LbServicesConfig.Tenants.Applications.Hosts.Services.Builder() - .type(serviceInfo.getServiceType()) - .clustertype(serviceInfo.getProperty("clustertype").orElse("")) - .clustername(serviceInfo.getProperty("clustername").orElse("")) - .configId(serviceInfo.getConfigId()) - .servicealiases(Stream.of(serviceInfo.getProperty("servicealiases").orElse("").split(",")). - filter(prop -> !"".equals(prop)).sorted((a, b) -> a.compareTo(b)).collect(Collectors.toList())) - .endpointaliases(endpointAliases) - .index(Integer.parseInt(serviceInfo.getProperty("index").orElse("999999"))); - serviceInfo.getPorts().forEach(portInfo -> { - LbServicesConfig.Tenants.Applications.Hosts.Services.Ports.Builder pb = new LbServicesConfig.Tenants.Applications.Hosts.Services.Ports.Builder() - .number(portInfo.getPort()) - .tags(Joiner.on(" ").join(portInfo.getTags())); - sb.ports(pb); - }); - return sb; - } } |