diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2018-10-21 22:16:44 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2018-10-21 22:16:44 +0200 |
commit | 71681c44d83df041b21a3163a8fde5d6a3492383 (patch) | |
tree | 1beaa5307fa941d472c16bac7031d8f1ecf9aa2d /config-model | |
parent | 5338f7546b6301dfd0b50ccdbfbffee1afbad695 (diff) |
GC unused parameters.
Diffstat (limited to 'config-model')
3 files changed, 15 insertions, 36 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/search/ContainerSearch.java b/config-model/src/main/java/com/yahoo/vespa/model/container/search/ContainerSearch.java index 900f798ea91..2cfd4b067cd 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/container/search/ContainerSearch.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/container/search/ContainerSearch.java @@ -1,10 +1,7 @@ // 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.container.search; -import com.yahoo.binaryprefix.BinaryPrefix; -import com.yahoo.binaryprefix.BinaryScaledAmount; import com.yahoo.container.bundle.BundleInstantiationSpecification; -import com.yahoo.lang.SettableOptional; import com.yahoo.osgi.provider.model.ComponentModel; import com.yahoo.prelude.fastsearch.FS4ResourcePool; import com.yahoo.prelude.semantics.SemanticRulesConfig; @@ -14,15 +11,21 @@ import com.yahoo.vespa.model.container.component.ContainerSubsystem; import com.yahoo.vespa.model.container.search.searchchain.HttpProvider; import com.yahoo.vespa.model.container.search.searchchain.LocalProvider; import com.yahoo.vespa.model.container.search.searchchain.SearchChains; -import com.yahoo.vespa.model.search.*; import com.yahoo.search.config.IndexInfoConfig; import com.yahoo.search.config.QrStartConfig; import com.yahoo.vespa.configdefinition.IlscriptsConfig; import com.yahoo.container.QrSearchersConfig; import com.yahoo.search.query.profile.config.QueryProfilesConfig; import com.yahoo.search.pagetemplates.PageTemplatesConfig; +import com.yahoo.vespa.model.search.AbstractSearchCluster; +import com.yahoo.vespa.model.search.Dispatch; +import com.yahoo.vespa.model.search.IndexedSearchCluster; +import com.yahoo.vespa.model.search.StreamingSearchCluster; -import java.util.*; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; /** * @author gjoranv @@ -41,9 +44,6 @@ public class ContainerSearch extends ContainerSubsystem<SearchChains> private final List<AbstractSearchCluster> systems = new LinkedList<>(); private final Options options; - // For legacy qrs clusters only. - private BinaryScaledAmount totalCacheSize = new BinaryScaledAmount(); - private QueryProfiles queryProfiles; private SemanticRules semanticRules; private PageTemplates pageTemplates; @@ -69,7 +69,7 @@ public class ContainerSearch extends ContainerSubsystem<SearchChains> // public for testing public void initializeSearchChains(Map<String, ? extends AbstractSearchCluster> searchClusters) { - getChains().initialize(searchClusters, totalCacheSize); + getChains().initialize(searchClusters); QrsCache defaultCacheOptions = getOptions().cacheSettings.get(""); if (defaultCacheOptions != null) { @@ -125,11 +125,7 @@ public class ContainerSearch extends ContainerSubsystem<SearchChains> } private int totalCacheSizeMb() { - if (!totalCacheSize.equals(new BinaryScaledAmount())) { - return (int) totalCacheSize.as(BinaryPrefix.mega); - } else { - return totalHttpProviderCacheSize(); - } + return totalHttpProviderCacheSize(); } private int totalHttpProviderCacheSize() { diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/SearchChains.java b/config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/SearchChains.java index c5913528435..42d81e19496 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/SearchChains.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/SearchChains.java @@ -1,7 +1,6 @@ // 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.container.search.searchchain; -import com.yahoo.binaryprefix.BinaryScaledAmount; import com.yahoo.collections.CollectionUtil; import com.yahoo.component.provider.ComponentRegistry; import com.yahoo.config.model.producer.AbstractConfigProducer; @@ -26,33 +25,19 @@ public class SearchChains extends Chains<SearchChain> { super(parent, subId); } - public void initialize(Map<String, ? extends AbstractSearchCluster> searchClustersByName, BinaryScaledAmount totalProviderCacheSize) { + public void initialize(Map<String, ? extends AbstractSearchCluster> searchClustersByName) { LocalClustersCreator.addDefaultLocalProviders(this, searchClustersByName.keySet()); VespaSearchChainsCreator.addVespaSearchChains(this); validateSourceGroups(); //must be done before initializing searchers since they are used by FederationSearchers. - initializeComponents(searchClustersByName, totalProviderCacheSize); + initializeComponents(searchClustersByName); } - private void initializeComponents(Map<String, ? extends AbstractSearchCluster> searchClustersByName, - BinaryScaledAmount totalProviderCacheSize) { + private void initializeComponents(Map<String, ? extends AbstractSearchCluster> searchClustersByName) { setSearchClusterForLocalProvider(searchClustersByName); - setCacheSizeForHttpProviders(totalProviderCacheSize); initializeComponents(); } - private void setCacheSizeForHttpProviders(BinaryScaledAmount totalProviderCacheSize) { - double totalCacheWeight = 0; - for (HttpProvider provider : httpProviders()) { - totalCacheWeight += provider.getCacheWeight(); - } - - final BinaryScaledAmount cacheUnit = totalProviderCacheSize.divide(totalCacheWeight); - for (HttpProvider provider : httpProviders()) { - provider.setCacheSize(cacheUnit.multiply(provider.getCacheWeight())); - } - } - private void setSearchClusterForLocalProvider(Map<String, ? extends AbstractSearchCluster> clusterIndexByName) { for (LocalProvider provider : localProviders()) { AbstractSearchCluster cluster = clusterIndexByName.get(provider.getClusterName()); @@ -81,7 +66,7 @@ public class SearchChains extends Chains<SearchChain> { super.validate(); } - public SourceGroupRegistry allSourceGroups() { + SourceGroupRegistry allSourceGroups() { return sourceGroups; } diff --git a/config-model/src/test/java/com/yahoo/vespa/model/container/search/searchchain/SearchChainsTestBase.java b/config-model/src/test/java/com/yahoo/vespa/model/container/search/searchchain/SearchChainsTestBase.java index 9f7cbfd9a5b..51a8333ef6e 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/container/search/searchchain/SearchChainsTestBase.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/container/search/searchchain/SearchChainsTestBase.java @@ -1,7 +1,6 @@ // 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.container.search.searchchain; -import com.yahoo.binaryprefix.BinaryPrefix; import com.yahoo.binaryprefix.BinaryScaledAmount; import com.yahoo.config.model.builder.xml.test.DomBuilderTest; import com.yahoo.vespa.model.builder.xml.dom.chains.search.DomSearchChainsBuilder; @@ -16,8 +15,7 @@ public abstract class SearchChainsTestBase extends DomBuilderTest { @Before public void setupSearchChains() { SearchChains searchChains = new DomSearchChainsBuilder().build(root.getDeployState(), root, servicesXml()); - searchChains.initialize(MockSearchClusters.twoMockClusterSpecsByName(root), - new BinaryScaledAmount(100, BinaryPrefix.mega)); + searchChains.initialize(MockSearchClusters.twoMockClusterSpecsByName(root)); root.freezeModelTopology(); } |