summaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo
diff options
context:
space:
mode:
Diffstat (limited to 'config-model/src/main/java/com/yahoo')
-rw-r--r--config-model/src/main/java/com/yahoo/config/model/ApplicationConfigProducerRoot.java28
-rw-r--r--config-model/src/main/java/com/yahoo/config/model/CommonConfigsProducer.java4
-rw-r--r--config-model/src/main/java/com/yahoo/config/model/provision/SingleNodeProvisioner.java1
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java37
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/routing/DocumentProtocol.java47
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/routing/Routing.java22
6 files changed, 13 insertions, 126 deletions
diff --git a/config-model/src/main/java/com/yahoo/config/model/ApplicationConfigProducerRoot.java b/config-model/src/main/java/com/yahoo/config/model/ApplicationConfigProducerRoot.java
index 061ad42e028..1cc5c93c28a 100644
--- a/config-model/src/main/java/com/yahoo/config/model/ApplicationConfigProducerRoot.java
+++ b/config-model/src/main/java/com/yahoo/config/model/ApplicationConfigProducerRoot.java
@@ -4,24 +4,22 @@ package com.yahoo.config.model;
import com.yahoo.cloud.config.ApplicationIdConfig;
import com.yahoo.cloud.config.ClusterListConfig;
import com.yahoo.cloud.config.ModelConfig;
+import com.yahoo.cloud.config.SlobroksConfig;
+import com.yahoo.cloud.config.ZookeepersConfig;
+import com.yahoo.config.model.deploy.DeployState;
+import com.yahoo.config.provision.ApplicationId;
+import com.yahoo.component.Version;
+import com.yahoo.vespa.config.content.LoadTypeConfig;
import com.yahoo.cloud.config.ModelConfig.Hosts;
import com.yahoo.cloud.config.ModelConfig.Hosts.Services;
import com.yahoo.cloud.config.ModelConfig.Hosts.Services.Ports;
-import com.yahoo.cloud.config.SlobroksConfig;
-import com.yahoo.cloud.config.ZookeepersConfig;
import com.yahoo.cloud.config.log.LogdConfig;
-import com.yahoo.component.Version;
-import com.yahoo.config.model.deploy.DeployState;
import com.yahoo.config.model.producer.AbstractConfigProducer;
-import com.yahoo.config.provision.ApplicationId;
import com.yahoo.document.DocumenttypesConfig;
import com.yahoo.document.config.DocumentmanagerConfig;
import com.yahoo.documentapi.messagebus.protocol.DocumentrouteselectorpolicyConfig;
-import com.yahoo.documentapi.messagebus.protocol.DocumentProtocolPoliciesConfig;
import com.yahoo.messagebus.MessagebusConfig;
import com.yahoo.vespa.config.content.AllClustersBucketSpacesConfig;
-import com.yahoo.vespa.config.content.DistributionConfig;
-import com.yahoo.vespa.config.content.LoadTypeConfig;
import com.yahoo.vespa.configmodel.producers.DocumentManager;
import com.yahoo.vespa.configmodel.producers.DocumentTypes;
import com.yahoo.vespa.documentmodel.DocumentModel;
@@ -167,13 +165,6 @@ public class ApplicationConfigProducerRoot extends AbstractConfigProducer<Abstra
}
@Override
- public void getConfig(DocumentProtocolPoliciesConfig.Builder builder) {
- if (routing != null) {
- routing.getConfig(builder);
- }
- }
-
- @Override
public void getConfig(MessagebusConfig.Builder builder) {
if (routing != null) {
routing.getConfig(builder);
@@ -222,13 +213,6 @@ public class ApplicationConfigProducerRoot extends AbstractConfigProducer<Abstra
}
@Override
- public void getConfig(DistributionConfig.Builder builder) {
- for (ContentCluster cluster : ((VespaModel) getRoot()).getContentClusters().values()) {
- cluster.getConfig(builder);
- }
- }
-
- @Override
public void getConfig(AllClustersBucketSpacesConfig.Builder builder) {
VespaModel model = (VespaModel) getRoot();
for (ContentCluster cluster : model.getContentClusters().values()) {
diff --git a/config-model/src/main/java/com/yahoo/config/model/CommonConfigsProducer.java b/config-model/src/main/java/com/yahoo/config/model/CommonConfigsProducer.java
index 312890aac13..9dcd94bf455 100644
--- a/config-model/src/main/java/com/yahoo/config/model/CommonConfigsProducer.java
+++ b/config-model/src/main/java/com/yahoo/config/model/CommonConfigsProducer.java
@@ -2,8 +2,6 @@
package com.yahoo.config.model;
import com.yahoo.cloud.config.ApplicationIdConfig;
-import com.yahoo.documentapi.messagebus.protocol.DocumentProtocolPoliciesConfig;
-import com.yahoo.vespa.config.content.DistributionConfig;
import com.yahoo.vespa.config.content.LoadTypeConfig;
import com.yahoo.cloud.config.log.LogdConfig;
import com.yahoo.cloud.config.SlobroksConfig;
@@ -27,13 +25,11 @@ public interface CommonConfigsProducer extends DocumentmanagerConfig.Producer,
DocumenttypesConfig.Producer,
MessagebusConfig.Producer,
DocumentrouteselectorpolicyConfig.Producer,
- DocumentProtocolPoliciesConfig.Producer,
LogdConfig.Producer,
SlobroksConfig.Producer,
ZookeepersConfig.Producer,
LoadTypeConfig.Producer,
ClusterListConfig.Producer,
- DistributionConfig.Producer,
AllClustersBucketSpacesConfig.Producer,
ModelConfig.Producer,
ApplicationIdConfig.Producer {
diff --git a/config-model/src/main/java/com/yahoo/config/model/provision/SingleNodeProvisioner.java b/config-model/src/main/java/com/yahoo/config/model/provision/SingleNodeProvisioner.java
index 0cfe35a51b5..d6cccc9f2be 100644
--- a/config-model/src/main/java/com/yahoo/config/model/provision/SingleNodeProvisioner.java
+++ b/config-model/src/main/java/com/yahoo/config/model/provision/SingleNodeProvisioner.java
@@ -10,6 +10,7 @@ import com.yahoo.config.provision.HostSpec;
import com.yahoo.config.provision.NodeResources;
import com.yahoo.config.provision.ProvisionLogger;
import com.yahoo.net.HostName;
+import com.yahoo.vespa.config.content.StorDistributionConfig;
import java.util.ArrayList;
import java.util.List;
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java
index a627e030156..7ec2dc67cf2 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java
@@ -15,7 +15,6 @@ import com.yahoo.documentapi.messagebus.protocol.DocumentProtocol;
import com.yahoo.documentmodel.NewDocumentType;
import com.yahoo.metrics.MetricsmanagerConfig;
import com.yahoo.vespa.config.content.AllClustersBucketSpacesConfig;
-import com.yahoo.vespa.config.content.DistributionConfig;
import com.yahoo.vespa.config.content.FleetcontrollerConfig;
import com.yahoo.vespa.config.content.MessagetyperouteselectorpolicyConfig;
import com.yahoo.vespa.config.content.StorDistributionConfig;
@@ -68,8 +67,6 @@ import java.util.TreeMap;
import java.util.logging.Level;
import java.util.stream.Collectors;
-import static java.util.stream.Collectors.toList;
-
/**
* A content cluster.
*
@@ -77,7 +74,6 @@ import static java.util.stream.Collectors.toList;
* @author bratseth
*/
public class ContentCluster extends AbstractConfigProducer implements
- DistributionConfig.Producer,
StorDistributionConfig.Producer,
StorDistributormanagerConfig.Producer,
FleetcontrollerConfig.Producer,
@@ -752,39 +748,6 @@ public class ContentCluster extends AbstractConfigProducer implements
}
}
- @Override
- public void getConfig(DistributionConfig.Builder builder) {
- DistributionConfig.Cluster.Builder clusterBuilder = new DistributionConfig.Cluster.Builder();
- StorDistributionConfig.Builder storDistributionBuilder = new StorDistributionConfig.Builder();
- getConfig(storDistributionBuilder);
- StorDistributionConfig config = storDistributionBuilder.build();
-
- clusterBuilder.active_per_leaf_group(config.active_per_leaf_group());
- clusterBuilder.ready_copies(config.ready_copies());
- clusterBuilder.redundancy(config.redundancy());
- clusterBuilder.initial_redundancy(config.initial_redundancy());
-
- for (StorDistributionConfig.Group group : config.group()) {
- DistributionConfig.Cluster.Group.Builder groupBuilder = new DistributionConfig.Cluster.Group.Builder();
- groupBuilder.index(group.index())
- .name(group.name())
- .capacity(group.capacity())
- .partitions(group.partitions());
-
- for (var node : group.nodes()) {
- DistributionConfig.Cluster.Group.Nodes.Builder nodesBuilder = new DistributionConfig.Cluster.Group.Nodes.Builder();
- nodesBuilder.index(node.index())
- .retired(node.retired());
-
- groupBuilder.nodes(nodesBuilder);
- }
-
- clusterBuilder.group(groupBuilder);
- }
-
- builder.cluster(getConfigId(), clusterBuilder);
- }
-
/**
* Mark whether the config emitted by this cluster currently should be applied by clients already running with
* a previous generation of it only by restarting the consuming processes.
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/routing/DocumentProtocol.java b/config-model/src/main/java/com/yahoo/vespa/model/routing/DocumentProtocol.java
index 15e6c5993b3..e6f4969f593 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/routing/DocumentProtocol.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/routing/DocumentProtocol.java
@@ -2,9 +2,8 @@
package com.yahoo.vespa.model.routing;
import com.yahoo.config.model.ConfigModelRepo;
-import com.yahoo.document.select.DocumentSelector;
import com.yahoo.documentapi.messagebus.protocol.DocumentrouteselectorpolicyConfig;
-import com.yahoo.documentapi.messagebus.protocol.DocumentProtocolPoliciesConfig;
+import com.yahoo.document.select.DocumentSelector;
import com.yahoo.messagebus.routing.ApplicationSpec;
import com.yahoo.messagebus.routing.HopSpec;
import com.yahoo.messagebus.routing.RouteSpec;
@@ -13,9 +12,9 @@ import com.yahoo.vespa.model.container.Container;
import com.yahoo.vespa.model.container.ContainerCluster;
import com.yahoo.vespa.model.container.ContainerModel;
import com.yahoo.vespa.model.container.docproc.ContainerDocproc;
-import com.yahoo.vespa.model.container.docproc.DocprocChain;
-import com.yahoo.vespa.model.content.Content;
import com.yahoo.vespa.model.content.cluster.ContentCluster;
+import com.yahoo.vespa.model.content.Content;
+import com.yahoo.vespa.model.container.docproc.DocprocChain;
import java.util.ArrayList;
import java.util.Collection;
@@ -32,9 +31,7 @@ import java.util.TreeMap;
*
* @author Simon Thoresen Hult
*/
-public final class DocumentProtocol implements Protocol,
- DocumentrouteselectorpolicyConfig.Producer,
- DocumentProtocolPoliciesConfig.Producer {
+public final class DocumentProtocol implements Protocol, DocumentrouteselectorpolicyConfig.Producer {
private static final String NAME = "document";
private final ApplicationSpec application;
@@ -104,42 +101,6 @@ public final class DocumentProtocol implements Protocol,
}
}
- @Override
- public void getConfig(DocumentProtocolPoliciesConfig.Builder builder) {
- for (ContentCluster cluster : Content.getContentClusters(repo)) {
- DocumentProtocolPoliciesConfig.Cluster.Builder clusterBuilder = new DocumentProtocolPoliciesConfig.Cluster.Builder();
- addSelector(cluster.getConfigId(), cluster.getRoutingSelector(), clusterBuilder);
- if (cluster.getSearch().hasIndexedCluster())
- addRoutes(getDirectRouteName(cluster.getConfigId()), getIndexedRouteName(cluster.getConfigId()), clusterBuilder);
-
- builder.cluster(cluster.getConfigId(), clusterBuilder);
- }
- }
-
- private static void addRoutes(String directRoute, String indexedRoute, DocumentProtocolPoliciesConfig.Cluster.Builder builder) {
- builder.defaultRoute(directRoute)
- .route(new DocumentProtocolPoliciesConfig.Cluster.Route.Builder()
- .messageType(com.yahoo.documentapi.messagebus.protocol.DocumentProtocol.MESSAGE_PUTDOCUMENT)
- .name(indexedRoute))
- .route(new DocumentProtocolPoliciesConfig.Cluster.Route.Builder()
- .messageType(com.yahoo.documentapi.messagebus.protocol.DocumentProtocol.MESSAGE_REMOVEDOCUMENT)
- .name(indexedRoute))
- .route(new DocumentProtocolPoliciesConfig.Cluster.Route.Builder()
- .messageType(com.yahoo.documentapi.messagebus.protocol.DocumentProtocol.MESSAGE_UPDATEDOCUMENT)
- .name(indexedRoute));
- }
-
- private static void addSelector(String clusterConfigId, String selector, DocumentProtocolPoliciesConfig.Cluster.Builder builder) {
- try {
- new DocumentSelector(selector);
- } catch (com.yahoo.document.select.parser.ParseException e) {
- throw new IllegalArgumentException("Failed to parse selector '" + selector +
- "' for route '" + clusterConfigId +
- "' in policy 'DocumentRouteSelector'.");
- }
- builder.selector(selector);
- }
-
private static void addRoute(String clusterConfigId, String selector, DocumentrouteselectorpolicyConfig.Builder builder) {
try {
new DocumentSelector(selector);
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/routing/Routing.java b/config-model/src/main/java/com/yahoo/vespa/model/routing/Routing.java
index 6637c84df10..36beb766f5b 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/routing/Routing.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/routing/Routing.java
@@ -4,20 +4,10 @@ package com.yahoo.vespa.model.routing;
import com.yahoo.config.model.ConfigModel;
import com.yahoo.config.model.ConfigModelContext;
import com.yahoo.config.model.ConfigModelRepo;
-import com.yahoo.documentapi.messagebus.protocol.DocumentProtocolPoliciesConfig;
+import com.yahoo.messagebus.routing.*;
import com.yahoo.messagebus.MessagebusConfig;
import com.yahoo.documentapi.messagebus.protocol.DocumentrouteselectorpolicyConfig;
-import com.yahoo.messagebus.routing.ApplicationSpec;
-import com.yahoo.messagebus.routing.HopSpec;
-import com.yahoo.messagebus.routing.RouteSpec;
-import com.yahoo.messagebus.routing.RoutingSpec;
-import com.yahoo.messagebus.routing.RoutingTableSpec;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
/**
* This is the routing plugin of the Vespa model. This class is responsible for parsing all routing information given
@@ -92,14 +82,6 @@ public class Routing extends ConfigModel {
}
}
- public void getConfig(DocumentProtocolPoliciesConfig.Builder builder) {
- for (Protocol protocol : protocols) {
- if (protocol instanceof DocumentProtocol) {
- ((DocumentProtocol) protocol).getConfig(builder);
- }
- }
- }
-
public void getConfig(DocumentrouteselectorpolicyConfig.Builder builder) {
for (Protocol protocol : protocols) {
if (protocol instanceof DocumentProtocol) {