diff options
author | Harald Musum <musum@verizonmedia.com> | 2020-05-20 14:11:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-20 14:11:55 +0200 |
commit | 091eed10afd6f0e6cec6608ba01e9c98e4a0e005 (patch) | |
tree | ca71a6d4fed25b40357f950754545b0c1458ae4f /container-search/src/main/java | |
parent | 034146bc6de7babdeecae443480f11cba4c3461b (diff) |
Revert "Gjoranv/create registry from config"
Diffstat (limited to 'container-search/src/main/java')
2 files changed, 3 insertions, 39 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/handler/SearchHandler.java b/container-search/src/main/java/com/yahoo/search/handler/SearchHandler.java index c658d404adb..c8386f3c75c 100644 --- a/container-search/src/main/java/com/yahoo/search/handler/SearchHandler.java +++ b/container-search/src/main/java/com/yahoo/search/handler/SearchHandler.java @@ -121,28 +121,6 @@ public class SearchHandler extends LoggingRequestHandler { Metric metric, Executor executor, AccessLog accessLog, - CompiledQueryProfileRegistry queryProfileRegistry, - ContainerHttpConfig containerHttpConfig, - ExecutionFactory executionFactory) { - this(statistics, - metric, - executor, - accessLog, - queryProfileRegistry, - executionFactory, - containerHttpConfig.numQueriesToTraceOnDebugAfterConstruction(), - containerHttpConfig.hostResponseHeaderKey().equals("") ? - Optional.empty() : Optional.of(containerHttpConfig.hostResponseHeaderKey())); - } - - /** - * @deprecated Use the @Inject annotated constructor instead. - */ - @Deprecated // Vespa 8 - public SearchHandler(Statistics statistics, - Metric metric, - Executor executor, - AccessLog accessLog, QueryProfilesConfig queryProfileConfig, ContainerHttpConfig containerHttpConfig, ExecutionFactory executionFactory) { @@ -154,7 +132,7 @@ public class SearchHandler extends LoggingRequestHandler { executionFactory, containerHttpConfig.numQueriesToTraceOnDebugAfterConstruction(), containerHttpConfig.hostResponseHeaderKey().equals("") ? - Optional.empty() : Optional.of( containerHttpConfig.hostResponseHeaderKey())); + Optional.empty() : Optional.of( containerHttpConfig.hostResponseHeaderKey())); } public SearchHandler(Statistics statistics, diff --git a/container-search/src/main/java/com/yahoo/search/query/profile/compiled/CompiledQueryProfileRegistry.java b/container-search/src/main/java/com/yahoo/search/query/profile/compiled/CompiledQueryProfileRegistry.java index 744c6eb6933..7ab05d0cd1e 100644 --- a/container-search/src/main/java/com/yahoo/search/query/profile/compiled/CompiledQueryProfileRegistry.java +++ b/container-search/src/main/java/com/yahoo/search/query/profile/compiled/CompiledQueryProfileRegistry.java @@ -1,14 +1,9 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.search.query.profile.compiled; -import com.google.inject.Inject; import com.yahoo.component.ComponentSpecification; import com.yahoo.component.provider.ComponentRegistry; -import com.yahoo.search.query.profile.QueryProfile; -import com.yahoo.search.query.profile.QueryProfileCompiler; -import com.yahoo.search.query.profile.QueryProfileRegistry; -import com.yahoo.search.query.profile.config.QueryProfileConfigurer; -import com.yahoo.search.query.profile.config.QueryProfilesConfig; +import com.yahoo.search.query.profile.types.QueryProfileType; import com.yahoo.search.query.profile.types.QueryProfileTypeRegistry; /** @@ -23,15 +18,6 @@ public class CompiledQueryProfileRegistry extends ComponentRegistry<CompiledQuer private final QueryProfileTypeRegistry typeRegistry; - @Inject - public CompiledQueryProfileRegistry(QueryProfilesConfig config) { - QueryProfileRegistry registry = QueryProfileConfigurer.createFromConfig(config); - typeRegistry = registry.getTypeRegistry(); - for (QueryProfile inputProfile : registry.allComponents()) { - register(QueryProfileCompiler.compile(inputProfile, this)); - } - } - /** Creates a compiled query profile registry with no types */ public CompiledQueryProfileRegistry() { this(QueryProfileTypeRegistry.emptyFrozen()); @@ -42,7 +28,7 @@ public class CompiledQueryProfileRegistry extends ComponentRegistry<CompiledQuer } /** Registers a type by its id */ - public final void register(CompiledQueryProfile profile) { + public void register(CompiledQueryProfile profile) { super.register(profile.getId(), profile); } |