summaryrefslogtreecommitdiffstats
path: root/config-model/src
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-10-28 19:19:53 +0100
committerGitHub <noreply@github.com>2020-10-28 19:19:53 +0100
commitcfb191565e170f698c66ca0a3819360667d3d638 (patch)
treebb8d16d15e5f86d4ff2b72f90a8bc1cbc7ba5f8f /config-model/src
parent5de88a16cb5a4f4c2f1b01539d553f871cfe5079 (diff)
parent59601cc25d74c03a690f407558acb03d32e1bd7e (diff)
Merge branch 'master' into balder/gc-unused-async-tls-flags
Diffstat (limited to 'config-model/src')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/ContainerModel.java4
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/routing/DocumentProtocol.java57
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/routing/Routing.java22
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/search/AbstractSearchCluster.java8
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/search/DispatchGroupBuilder.java51
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/search/DocumentDatabase.java5
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/search/DocumentSelectionConverter.java6
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/search/IndexedSearchCluster.java20
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/search/IndexingDocprocChain.java10
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/search/IndexingProcessor.java6
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/search/SearchCluster.java4
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/search/SearchNode.java4
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/search/StreamingSearchCluster.java6
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/search/TransactionLogServer.java2
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/search/Tuning.java4
15 files changed, 77 insertions, 132 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerModel.java b/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerModel.java
index 67870dc049d..8d13609424a 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerModel.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerModel.java
@@ -54,8 +54,8 @@ public class ContainerModel extends ConfigModel {
getCluster().initialize(searchClustersByName);
}
- public static Collection<ContainerCluster> containerClusters(ConfigModelRepo models) {
- List<ContainerCluster> containerClusters = new ArrayList<>();
+ public static Collection<ContainerCluster<?>> containerClusters(ConfigModelRepo models) {
+ List<ContainerCluster<?>> containerClusters = new ArrayList<>();
for (ContainerModel model: models.getModels(ContainerModel.class))
containerClusters.add(model.getCluster());
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 c2a85790f89..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
@@ -49,7 +49,7 @@ public final class DocumentProtocol implements Protocol, Documentrouteselectorpo
/**
* Constructs a new document protocol based on the content of the given plugins.
*
- * @param plugins The plugins to reflect on.
+ * @param plugins the plugins to reflect on
*/
DocumentProtocol(ConfigModelRepo plugins) {
application = createApplicationSpec(plugins);
@@ -61,8 +61,8 @@ public final class DocumentProtocol implements Protocol, Documentrouteselectorpo
* Creates a service index based on the plugins loaded. This means to fill the index with all services known by this
* protocol by traversing the plugins.
*
- * @param plugins All initialized plugins of the Vespa model.
- * @return The index of all known services.
+ * @param plugins All initialized plugins of the Vespa model
+ * @return the index of all known services
*/
private static ApplicationSpec createApplicationSpec(ConfigModelRepo plugins) {
ApplicationSpec ret = new ApplicationSpec();
@@ -73,12 +73,12 @@ public final class DocumentProtocol implements Protocol, Documentrouteselectorpo
}
}
- for (ContainerCluster containerCluster: ContainerModel.containerClusters(plugins)) {
+ for (ContainerCluster<?> containerCluster: ContainerModel.containerClusters(plugins)) {
ContainerDocproc containerDocproc = containerCluster.getDocproc();
if (containerDocproc != null) {
createDocprocChainSpec(ret,
- containerDocproc.getChains().allChains().allComponents(),
- containerCluster.getContainers());
+ containerDocproc.getChains().allChains().allComponents(),
+ containerCluster.getContainers());
}
}
@@ -87,7 +87,7 @@ public final class DocumentProtocol implements Protocol, Documentrouteselectorpo
private static void createDocprocChainSpec(ApplicationSpec spec,
List<DocprocChain> docprocChains,
- List<Container> containerNodes) {
+ List<? extends Container> containerNodes) {
for (DocprocChain chain: docprocChains) {
for (Container node: containerNodes)
spec.addService(NAME, node.getConfigId() + "/chain." + chain.getComponentId().stringValue());
@@ -105,8 +105,9 @@ public final class DocumentProtocol implements Protocol, Documentrouteselectorpo
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'.");
+ throw new IllegalArgumentException("Failed to parse selector '" + selector +
+ "' for route '" + clusterConfigId +
+ "' in policy 'DocumentRouteSelector'.");
}
DocumentrouteselectorpolicyConfig.Route.Builder routeBuilder = new DocumentrouteselectorpolicyConfig.Route.Builder();
routeBuilder.name(clusterConfigId);
@@ -117,13 +118,13 @@ public final class DocumentProtocol implements Protocol, Documentrouteselectorpo
/**
* This function extrapolates any routes for the document protocol that it can from the vespa model.
*
- * @param plugins All initialized plugins of the vespa model.
- * @return Routing table for the document protocol.
+ * @param plugins all initialized plugins of the vespa model
+ * @return routing table for the document protocol
*/
private static RoutingTableSpec createRoutingTable(ConfigModelRepo plugins) {
// Build simple hops and routes.
List<ContentCluster> content = Content.getContentClusters(plugins);
- Collection<ContainerCluster> containerClusters = ContainerModel.containerClusters(plugins);
+ Collection<ContainerCluster<?>> containerClusters = ContainerModel.containerClusters(plugins);
RoutingTableSpec table = new RoutingTableSpec(NAME);
addContainerClusterDocprocHops(containerClusters, table);
@@ -140,10 +141,10 @@ public final class DocumentProtocol implements Protocol, Documentrouteselectorpo
return table;
}
- private static void addContainerClusterDocprocHops(Collection<ContainerCluster> containerClusters,
+ private static void addContainerClusterDocprocHops(Collection<ContainerCluster<?>> containerClusters,
RoutingTableSpec table) {
- for (ContainerCluster cluster: containerClusters) {
+ for (ContainerCluster<?> cluster: containerClusters) {
ContainerDocproc docproc = cluster.getDocproc();
if (docproc != null) {
@@ -182,8 +183,8 @@ public final class DocumentProtocol implements Protocol, Documentrouteselectorpo
* Create hops to all configured storage nodes for the Document protocol. The "Distributor" policy resolves its
* recipients using slobrok lookups, so it requires no configured recipients.
*
- * @param content The storage model from {@link com.yahoo.vespa.model.VespaModel}.
- * @param table The routing table to add to.
+ * @param content the storage model from {@link com.yahoo.vespa.model.VespaModel}
+ * @param table the routing table to add to
*/
private static void addContentRouting(List<ContentCluster> content, RoutingTableSpec table) {
@@ -210,7 +211,7 @@ public final class DocumentProtocol implements Protocol, Documentrouteselectorpo
* policy "SearchCluster" will decide which cluster(s) are to receive every document passed through it based on a
* document select string derived from services.xml.
*
- * @param table The routing table to add to.
+ * @param table the routing table to add to
*/
private static void addIndexingHop(List<ContentCluster> content, RoutingTableSpec table) {
if (content.isEmpty()) {
@@ -232,12 +233,12 @@ public final class DocumentProtocol implements Protocol, Documentrouteselectorpo
* is an unambiguous docproc cluster in the application, the {@code default} route will pass through it.
* The {@code default-get} route skips the docproc but is otherwise identical to the {@code default} route.
*
- * @param content The content model from {@link com.yahoo.vespa.model.VespaModel}.
+ * @param content the content model from {@link com.yahoo.vespa.model.VespaModel}
* @param containerClusters a collection of {@link com.yahoo.vespa.model.container.ContainerCluster}s
- * @param table The routing table to add to.
+ * @param table the routing table to add to
*/
private static void addDefaultRoutes(List<ContentCluster> content,
- Collection<ContainerCluster> containerClusters,
+ Collection<ContainerCluster<?>> containerClusters,
RoutingTableSpec table) {
if (content.isEmpty() || !indexingHopExists(table)) {
return;
@@ -268,22 +269,19 @@ public final class DocumentProtocol implements Protocol, Documentrouteselectorpo
return false;
}
- private static String getContainerClustersDocprocHop(Collection<ContainerCluster> containerClusters) {
+ private static String getContainerClustersDocprocHop(Collection<ContainerCluster<?>> containerClusters) {
DocprocChain result = null;
- for (ContainerCluster containerCluster: containerClusters) {
+ for (ContainerCluster<?> containerCluster: containerClusters) {
DocprocChain defaultChain = getDefaultChain(containerCluster.getDocproc());
if (defaultChain != null) {
if (result != null)
throw new RuntimeException("Only a single default docproc chain is allowed across all container clusters");
-
result = defaultChain;
}
}
- return result == null ?
- null:
- result.getServiceName();
+ return result == null ? null: result.getServiceName();
}
private static DocprocChain getDefaultChain(ContainerDocproc docproc) {
@@ -297,7 +295,7 @@ public final class DocumentProtocol implements Protocol, Documentrouteselectorpo
* the second naming element. This can only be done to those routes that do not share primary name elements with
* other routes (e.g. a search clusters with the same name as a storage cluster).
*
- * @param table The routing table whose route names are to be simplified.
+ * @param table the routing table whose route names are to be simplified
*/
private static void simplifyRouteNames(RoutingTableSpec table) {
if (table == null || !table.hasRoutes()) {
@@ -356,8 +354,8 @@ public final class DocumentProtocol implements Protocol, Documentrouteselectorpo
* Returns a simplified version of the given route name. This method will remove the first component of the name as
* separated by a forward slash, and then remove the first component of the remaining name as separated by a dot.
*
- * @param name The route name to simplify.
- * @return The simplified route name.
+ * @param name the route name to simplify
+ * @return the simplified route name
*/
private static String simplifyRouteName(String name) {
String[] foo = name.split("/", 2);
@@ -380,4 +378,5 @@ public final class DocumentProtocol implements Protocol, Documentrouteselectorpo
public RoutingTableSpec getRoutingTableSpec() {
return routingTable;
}
+
}
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 2403594d331..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
@@ -32,7 +32,7 @@ public class Routing extends ConfigModel {
* Sets the application specification to include when verifying the complete routing config. This needs to be
* invoked before {@link #deriveCommonSettings(com.yahoo.config.model.ConfigModelRepo)} to be included.
*
- * @param app The application specification to include.
+ * @param app the application specification to include
*/
public void setExplicitApplicationSpec(ApplicationSpec app) {
explicitApplication = app;
@@ -42,7 +42,7 @@ public class Routing extends ConfigModel {
* Sets the routing specification to include in the derived routing config. This needs to be invoked before
* {@link #deriveCommonSettings(com.yahoo.config.model.ConfigModelRepo)} to be included.
*
- * @param routing The routing specification to include.
+ * @param routing the routing specification to include
*/
public void setExplicitRoutingSpec(RoutingSpec routing) {
explicitRouting = routing;
@@ -53,7 +53,7 @@ public class Routing extends ConfigModel {
/**
* Derives all routing settings that can be found by inspecting the given plugin container.
*
- * @param plugins All initialized plugins of the vespa model.
+ * @param plugins all initialized plugins of the vespa model
*/
public void deriveCommonSettings(ConfigModelRepo plugins) {
// Combine explicit routing with protocol derived routing.
@@ -141,8 +141,8 @@ public class Routing extends ConfigModel {
* Adds the given routing table to the given routing spec. This method will not copy hops or routes that are already
* defined in the target table.
*
- * @param routing The routing spec to add to.
- * @param from The table to copy content from.
+ * @param routing the routing spec to add to
+ * @param from the table to copy content from
*/
private static void addRoutingTable(RoutingSpec routing, RoutingTableSpec from) {
RoutingTableSpec to = getRoutingTable(routing, from.getProtocol());
@@ -176,9 +176,9 @@ public class Routing extends ConfigModel {
/**
* Returns the routing table from the given routing spec that belongs to the named protocol.
*
- * @param routing The routing whose tables to search through.
- * @param protocol The name of the protocol whose table to return.
- * @return The routing table found, or null.
+ * @param routing the routing whose tables to search through
+ * @param protocol the name of the protocol whose table to return
+ * @return the routing table found, or null
*/
private static RoutingTableSpec getRoutingTable(RoutingSpec routing, String protocol) {
for (int i = 0, len = routing.getNumTables(); i < len; ++i) {
@@ -190,11 +190,7 @@ public class Routing extends ConfigModel {
return null;
}
- /**
- * Returns a list of errors found when preparing the routing configuration.
- *
- * @return The error list.
- */
+ /** Returns a list of errors found when preparing the routing configuration. */
public List<String> getErrors() {
return Collections.unmodifiableList(errors);
}
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/search/AbstractSearchCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/search/AbstractSearchCluster.java
index 3f03df0107e..705c48d1c9b 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/search/AbstractSearchCluster.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/search/AbstractSearchCluster.java
@@ -18,7 +18,7 @@ import java.util.List;
*
* @author Peter Boros
*/
-public abstract class AbstractSearchCluster extends AbstractConfigProducer
+public abstract class AbstractSearchCluster extends AbstractConfigProducer<AbstractSearchCluster>
implements
DocumentdbInfoConfig.Producer,
IndexInfoConfig.Producer,
@@ -28,10 +28,10 @@ public abstract class AbstractSearchCluster extends AbstractConfigProducer
protected String clusterName;
protected int index;
private Double visibilityDelay = 0.0;
- private List<String> documentNames = new ArrayList<>();
- private List<SchemaSpec> localSDS = new LinkedList<>();
+ private final List<String> documentNames = new ArrayList<>();
+ private final List<SchemaSpec> localSDS = new LinkedList<>();
- public AbstractSearchCluster(AbstractConfigProducer parent, String clusterName, int index) {
+ public AbstractSearchCluster(AbstractConfigProducer<?> parent, String clusterName, int index) {
super(parent, "cluster." + clusterName);
this.clusterName = clusterName;
this.index = index;
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/search/DispatchGroupBuilder.java b/config-model/src/main/java/com/yahoo/vespa/model/search/DispatchGroupBuilder.java
index b489c5b9242..dc3d6d9dc58 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/search/DispatchGroupBuilder.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/search/DispatchGroupBuilder.java
@@ -1,13 +1,10 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.search;
-import com.yahoo.vespa.model.SimpleConfigProducer;
import com.yahoo.vespa.model.content.DispatchSpec;
import java.util.ArrayList;
-import java.util.LinkedHashMap;
import java.util.List;
-import java.util.Map;
/**
* Class used to build the mid-level dispatch groups in an indexed content cluster.
@@ -16,53 +13,6 @@ import java.util.Map;
*/
public class DispatchGroupBuilder {
- private final SimpleConfigProducer dispatchParent;
- private final DispatchGroup rootDispatch;
- private final IndexedSearchCluster searchCluster;
-
- public DispatchGroupBuilder(SimpleConfigProducer dispatchParent,
- DispatchGroup rootDispatch,
- IndexedSearchCluster searchCluster) {
- this.dispatchParent = dispatchParent;
- this.rootDispatch = rootDispatch;
- this.searchCluster = searchCluster;
- }
-
- public void build(List<DispatchSpec.Group> groupsSpec, List<SearchNode> searchNodes) {
- Map<Integer, SearchNode> searchNodeMap = buildSearchNodeMap(searchNodes);
- for (int partId = 0; partId < groupsSpec.size(); ++partId) {
- DispatchSpec.Group groupSpec = groupsSpec.get(partId);
- DispatchGroup group = new DispatchGroup(searchCluster);
- populateDispatchGroup(group, groupSpec.getNodes(), searchNodeMap, partId);
- }
- }
-
- private void populateDispatchGroup(DispatchGroup group,
- List<DispatchSpec.Node> nodeList,
- Map<Integer, SearchNode> searchNodesMap,
- int partId) {
- for (int rowId = 0; rowId < nodeList.size(); ++rowId) {
- int distributionKey = nodeList.get(rowId).getDistributionKey();
- SearchNode searchNode = searchNodesMap.get(distributionKey);
-
- // Note: the rowId in this context will be the partId for the underlying search node.
- group.addSearcher(buildSearchInterface(searchNode, rowId));
- }
- }
-
- private static SearchInterface buildSearchInterface(SearchNode searchNode, int partId) {
- searchNode.updatePartition(partId); // ensure that search node uses the same partId as dispatch sees
- return new SearchNodeWrapper(new NodeSpec(0, partId), searchNode);
- }
-
- private static Map<Integer, SearchNode> buildSearchNodeMap(List<SearchNode> searchNodes) {
- Map<Integer, SearchNode> retval = new LinkedHashMap<>();
- for (SearchNode node : searchNodes) {
- retval.put(node.getDistributionKey(), node);
- }
- return retval;
- }
-
public static List<DispatchSpec.Group> createDispatchGroups(List<SearchNode> searchNodes,
int numDispatchGroups) {
if (numDispatchGroups > searchNodes.size())
@@ -84,5 +34,6 @@ public class DispatchGroupBuilder {
assert(searchNodeIdx == searchNodes.size());
return groupsSpec;
}
+
}
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/search/DocumentDatabase.java b/config-model/src/main/java/com/yahoo/vespa/model/search/DocumentDatabase.java
index 57ae4cf3a5b..8d4c1675bbf 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/search/DocumentDatabase.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/search/DocumentDatabase.java
@@ -20,7 +20,7 @@ import com.yahoo.vespa.configdefinition.IlscriptsConfig;
*
* @author geirst
*/
-public class DocumentDatabase extends AbstractConfigProducer implements
+public class DocumentDatabase extends AbstractConfigProducer<DocumentDatabase> implements
IndexInfoConfig.Producer,
IlscriptsConfig.Producer,
AttributesConfig.Producer,
@@ -36,7 +36,7 @@ public class DocumentDatabase extends AbstractConfigProducer implements
private final String inputDocType;
private final DerivedConfiguration derivedCfg;
- public DocumentDatabase(AbstractConfigProducer parent, String inputDocType, DerivedConfiguration derivedCfg) {
+ public DocumentDatabase(AbstractConfigProducer<?> parent, String inputDocType, DerivedConfiguration derivedCfg) {
super(parent, inputDocType);
this.inputDocType = inputDocType;
this.derivedCfg = derivedCfg;
@@ -108,4 +108,5 @@ public class DocumentDatabase extends AbstractConfigProducer implements
public void getConfig(ImportedFieldsConfig.Builder builder) {
derivedCfg.getImportedFields().getConfig(builder);
}
+
}
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/search/DocumentSelectionConverter.java b/config-model/src/main/java/com/yahoo/vespa/model/search/DocumentSelectionConverter.java
index 4416e798da3..0efee8f10f4 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/search/DocumentSelectionConverter.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/search/DocumentSelectionConverter.java
@@ -31,7 +31,8 @@ public class DocumentSelectionConverter {
/**
* Transforms the selection into a search query.
- * @return A search query representing the selection.
+ *
+ * @return a search query representing the selection
*/
public String getQuery(String documentType) {
if (queryExpressionMap == null)
@@ -43,7 +44,8 @@ public class DocumentSelectionConverter {
/**
* Transforms the selection into an inverted search query.
- * @return A search query representing the selection.
+ *
+ * @return a search query representing the selection
*/
public String getInvertedQuery(String documentType) {
String query = getQuery(documentType);
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/search/IndexedSearchCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/search/IndexedSearchCluster.java
index ef8c236fd94..99f1b3ad34e 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/search/IndexedSearchCluster.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/search/IndexedSearchCluster.java
@@ -44,7 +44,7 @@ public class IndexedSearchCluster extends SearchCluster
// This is the document selector string as derived from the subscription tag.
private String routingSelector = null;
- private List<DocumentDatabase> documentDbs = new LinkedList<>();
+ private final List<DocumentDatabase> documentDbs = new LinkedList<>();
private final UnionConfiguration unionCfg;
private int maxNodesDownPerFixedRow = 0;
@@ -52,7 +52,7 @@ public class IndexedSearchCluster extends SearchCluster
private final DispatchGroup rootDispatch;
private DispatchSpec dispatchSpec;
- private List<SearchNode> searchNodes = new ArrayList<>();
+ private final List<SearchNode> searchNodes = new ArrayList<>();
/**
* Returns the document selector that is able to resolve what documents are to be routed to this search cluster.
@@ -64,7 +64,7 @@ public class IndexedSearchCluster extends SearchCluster
return routingSelector;
}
- public IndexedSearchCluster(AbstractConfigProducer parent, String clusterName, int index, DeployState deployState) {
+ public IndexedSearchCluster(AbstractConfigProducer<SearchCluster> parent, String clusterName, int index, DeployState deployState) {
super(parent, clusterName, index);
unionCfg = new UnionConfiguration(this, documentDbs);
rootDispatch = new DispatchGroup(this);
@@ -86,7 +86,7 @@ public class IndexedSearchCluster extends SearchCluster
* services file on initialization, this can NOT be used at runtime to determine indexing chain. When initialization
* is done, the {@link #getIndexingServiceName()} method holds the actual indexing docproc chain object.
*
- * @return The name of the docproc cluster associated with this.
+ * @return the name of the docproc cluster associated with this
*/
public String getIndexingClusterName() {
return hasExplicitIndexingCluster() ? indexingClusterName : getClusterName() + ".indexing";
@@ -104,7 +104,7 @@ public class IndexedSearchCluster extends SearchCluster
* Sets the name of the docproc cluster running indexing for this search cluster. This is for initial configuration,
* and will not reflect the actual indexing chain. See {@link #getIndexingClusterName} for more detail.
*
- * @param name The name of the docproc cluster associated with this.
+ * @param name the name of the docproc cluster associated with this
*/
public void setIndexingClusterName(String name) {
indexingClusterName = name;
@@ -118,8 +118,8 @@ public class IndexedSearchCluster extends SearchCluster
* Sets the docproc chain that will be running indexing for this search cluster. This is set by the
* {@link com.yahoo.vespa.model.content.Content} model during build.
*
- * @param chain the chain that is to run indexing for this cluster.
- * @return this, to allow chaining.
+ * @param chain the chain that is to run indexing for this cluster
+ * @return this, to allow chaining
*/
public AbstractSearchCluster setIndexingChain(DocprocChain chain) {
indexingChain = chain;
@@ -280,7 +280,7 @@ public class IndexedSearchCluster extends SearchCluster
if (dispatchSpec.getNumDispatchGroups() != null) {
this.dispatchSpec = new DispatchSpec.Builder().setGroups
(DispatchGroupBuilder.createDispatchGroups(getSearchNodes(),
- dispatchSpec.getNumDispatchGroups())).build();
+ dispatchSpec.getNumDispatchGroups())).build();
} else {
this.dispatchSpec = dispatchSpec;
}
@@ -343,7 +343,7 @@ public class IndexedSearchCluster extends SearchCluster
* which is the parent to this. This avoids building the config multiple times.
*/
public static class UnionConfiguration
- extends AbstractConfigProducer
+ extends AbstractConfigProducer<UnionConfiguration>
implements AttributesConfig.Producer {
private final List<DocumentDatabase> docDbs;
@@ -372,7 +372,7 @@ public class IndexedSearchCluster extends SearchCluster
}
}
- private UnionConfiguration(AbstractConfigProducer parent, List<DocumentDatabase> docDbs) {
+ private UnionConfiguration(AbstractConfigProducer<?> parent, List<DocumentDatabase> docDbs) {
super(parent, "union");
this.docDbs = docDbs;
}
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/search/IndexingDocprocChain.java b/config-model/src/main/java/com/yahoo/vespa/model/search/IndexingDocprocChain.java
index df44a429f9c..2c1d979e2c4 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/search/IndexingDocprocChain.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/search/IndexingDocprocChain.java
@@ -12,6 +12,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
+import java.util.Set;
/**
* @author Einar M R Rosenvinge
@@ -22,16 +23,15 @@ public class IndexingDocprocChain extends DocprocChain implements SpecialtokensC
private static final List<Phase> phases = new ArrayList<>(2);
static {
- phases.add(new Phase("indexingStart", Collections.<String>emptySet(), Collections.<String>emptySet()));
- phases.add(new Phase("indexingEnd", Collections.<String>emptySet(), Collections.<String>emptySet()));
+ phases.add(new Phase("indexingStart", Set.of(), Set.of()));
+ phases.add(new Phase("indexingEnd", Set.of(), Set.of()));
}
public IndexingDocprocChain() {
super(new ChainSpecification(new ComponentId(NAME),
- new ChainSpecification.Inheritance(Collections.<ComponentSpecification>emptySet(),
- Collections.<ComponentSpecification>emptySet()),
+ new ChainSpecification.Inheritance(Set.of(), Set.of()),
phases,
- Collections.<ComponentSpecification>emptySet()),
+ Set.of()),
new HashMap<>());
addInnerComponent(new IndexingProcessor());
}
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/search/IndexingProcessor.java b/config-model/src/main/java/com/yahoo/vespa/model/search/IndexingProcessor.java
index 9ce26778c0d..b8908e4438a 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/search/IndexingProcessor.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/search/IndexingProcessor.java
@@ -8,8 +8,8 @@ import com.yahoo.component.chain.dependencies.Dependencies;
import com.yahoo.vespa.model.container.docproc.DocumentProcessor;
import com.yahoo.vespa.model.container.docproc.model.DocumentProcessorModel;
-import java.util.Collections;
import java.util.HashMap;
+import java.util.List;
/**
* @author Einar M R Rosenvinge
@@ -22,9 +22,7 @@ public class IndexingProcessor extends DocumentProcessor {
super(new DocumentProcessorModel(new BundleInstantiationSpecification(new ComponentId(DocumentProcessor.INDEXER),
new ComponentSpecification(DocumentProcessor.INDEXER),
new ComponentSpecification(docprocsBundleSpecification)),
- new Dependencies(Collections.<String>emptyList(),
- Collections.<String>emptyList(),
- Collections.<String>emptyList()),
+ new Dependencies(List.of(), List.of(), List.of()),
new HashMap<>()));
}
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/search/SearchCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/search/SearchCluster.java
index 64dfb3b5597..37fbc68cb3d 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/search/SearchCluster.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/search/SearchCluster.java
@@ -29,9 +29,7 @@ public abstract class SearchCluster extends AbstractSearchCluster
IndexInfoConfig.Producer,
IlscriptsConfig.Producer {
- private static final long serialVersionUID = 1L;
-
- protected SearchCluster(AbstractConfigProducer parent, String clusterName, int index) {
+ protected SearchCluster(AbstractConfigProducer<SearchCluster> parent, String clusterName, int index) {
super(parent, clusterName, index);
}
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/search/SearchNode.java b/config-model/src/main/java/com/yahoo/vespa/model/search/SearchNode.java
index 51393cf51cf..c8cf9407a31 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/search/SearchNode.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/search/SearchNode.java
@@ -319,9 +319,7 @@ public class SearchNode extends AbstractService implements
periods(point.getIntervalSeconds()).periods(300));
}
builder.consumer(
- new MetricsmanagerConfig.Consumer.Builder().
- name("log").
- tags("logdefault"));
+ new MetricsmanagerConfig.Consumer.Builder().name("log").tags("logdefault"));
}
@Override
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/search/StreamingSearchCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/search/StreamingSearchCluster.java
index aa735d5ae4c..890e42eb60c 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/search/StreamingSearchCluster.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/search/StreamingSearchCluster.java
@@ -31,8 +31,8 @@ public class StreamingSearchCluster extends SearchCluster implements
SummaryConfig.Producer
{
- private class AttributesProducer extends AbstractConfigProducer implements AttributesConfig.Producer {
- AttributesProducer(AbstractConfigProducer parent, String docType) {
+ private class AttributesProducer extends AbstractConfigProducer<AttributesProducer> implements AttributesConfig.Producer {
+ AttributesProducer(AbstractConfigProducer<?> parent, String docType) {
super(parent, docType);
}
@@ -49,7 +49,7 @@ public class StreamingSearchCluster extends SearchCluster implements
private final String docTypeName;
private DerivedConfiguration sdConfig = null;
- public StreamingSearchCluster(AbstractConfigProducer parent, String clusterName, int index, String docTypeName, String storageRouteSpec) {
+ public StreamingSearchCluster(AbstractConfigProducer<SearchCluster> parent, String clusterName, int index, String docTypeName, String storageRouteSpec) {
super(parent, clusterName, index);
attributesConfig = new AttributesProducer(parent, docTypeName);
this.docTypeName = docTypeName;
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/search/TransactionLogServer.java b/config-model/src/main/java/com/yahoo/vespa/model/search/TransactionLogServer.java
index 65aa32c255c..7c3f9bc1001 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/search/TransactionLogServer.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/search/TransactionLogServer.java
@@ -33,6 +33,7 @@ public class TransactionLogServer extends AbstractService {
}
public static class Builder extends VespaDomBuilder.DomConfigProducerBuilder<TransactionLogServer> {
+
private final String clusterName;
public Builder(String clusterName) {
this.clusterName = clusterName;
@@ -42,6 +43,7 @@ public class TransactionLogServer extends AbstractService {
protected TransactionLogServer doBuild(DeployState deployState, AbstractConfigProducer ancestor, Element producerSpec) {
return new TransactionLogServer(ancestor, clusterName);
}
+
}
public int getPortCount() {
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/search/Tuning.java b/config-model/src/main/java/com/yahoo/vespa/model/search/Tuning.java
index d8a2e67bf9a..ea0f0130e2b 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/search/Tuning.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/search/Tuning.java
@@ -13,7 +13,7 @@ import static com.yahoo.text.Lowercase.toLowerCase;
*
* @author geirst
*/
-public class Tuning extends AbstractConfigProducer implements ProtonConfig.Producer {
+public class Tuning extends AbstractConfigProducer<Tuning> implements ProtonConfig.Producer {
public static class SearchNode implements ProtonConfig.Producer {
@@ -397,7 +397,7 @@ public class Tuning extends AbstractConfigProducer implements ProtonConfig.Produ
public DispatchTuning dispatch = DispatchTuning.empty;
public SearchNode searchNode;
- public Tuning(AbstractConfigProducer parent) {
+ public Tuning(AbstractConfigProducer<?> parent) {
super(parent, "tuning");
}