diff options
author | gjoranv <gv@oath.com> | 2018-08-21 13:55:20 +0200 |
---|---|---|
committer | gjoranv <gv@oath.com> | 2018-08-21 13:55:20 +0200 |
commit | e310655670750c24fa33067f31a12ef30ff01d84 (patch) | |
tree | 6e7de6fff7d22005422d9355ad3aaafca46f06eb | |
parent | e30b1d22b1cd4a949c20bad35b5f6571db553ab5 (diff) |
Revert "Remove ConfiguredHttpClientSearcher"
- Do not remove until Vespa 7
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/federation/http/ConfiguredHTTPClientSearcher.java | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/federation/http/ConfiguredHTTPClientSearcher.java b/container-search/src/main/java/com/yahoo/search/federation/http/ConfiguredHTTPClientSearcher.java new file mode 100644 index 00000000000..8abd6deb5f9 --- /dev/null +++ b/container-search/src/main/java/com/yahoo/search/federation/http/ConfiguredHTTPClientSearcher.java @@ -0,0 +1,38 @@ +// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.search.federation.http; + +import java.util.Collections; + +import com.yahoo.component.ComponentId; +import com.yahoo.search.federation.ProviderConfig; +import com.yahoo.search.Result; +import com.yahoo.search.searchchain.Execution; +import com.yahoo.statistics.Statistics; + + +/** + * Superclass for http client searchers which depends on config. All this is doing is translating + * the provider and cache configurations to parameters which are passed upwards. + * + * @author bratseth + */ +@Deprecated +public abstract class ConfiguredHTTPClientSearcher extends HTTPClientSearcher { + + /** Create this from a configuraton */ + public ConfiguredHTTPClientSearcher(final ComponentId id, final ProviderConfig providerConfig, Statistics manager) { + super(id, ConfiguredSearcherHelper.toConnectionList(providerConfig), new HTTPParameters(providerConfig), manager); + } + + /** Create an instance from direct parameters having a single connection. Useful for testing */ + public ConfiguredHTTPClientSearcher(String idString,String host,int port,String path, Statistics manager) { + super(new ComponentId(idString), Collections.singletonList(new Connection(host,port)),path, manager); + } + + /** Forwards to the next in chain fill(result,summaryName) */ + @Override + public void fill(Result result,String summaryName, Execution execution,Connection connection) { + execution.fill(result,summaryName); + } + +} |