@Deprecated public abstract class HTTPProviderSearcher extends HTTPSearcher
Implementations must override one of the unmarshal
methods to unmarshal the response.
HTTPSearcher.SearcherHttpClient, HTTPSearcher.ThrowingCertificateStore
Modifier and Type | Field and Description |
---|---|
protected String |
cacheName
Deprecated.
The name of the cache used (which is just getid().stringValue(), or null if no cache is used
|
private com.yahoo.statistics.Counter |
emptyResults
Deprecated.
|
private static List<String> |
excludedSourceProperties
Deprecated.
|
private com.yahoo.statistics.Value |
hitsPerQuery
Deprecated.
|
protected static Logger |
log
Deprecated.
|
private com.yahoo.statistics.Counter |
readTimeouts
Deprecated.
|
private com.yahoo.statistics.Value |
responseLatency
Deprecated.
|
certificateProxy, IP_ADDRESS_UNKNOWN, LOG_CONNECT_TIMEOUT_PREFIX, LOG_HEADER_PREFIX, LOG_HITCOUNT, LOG_HOST, LOG_IP_ADDRESS, LOG_LATENCY_CONNECT, LOG_LATENCY_FINISH, LOG_LATENCY_START, LOG_PATH, LOG_PORT, LOG_PROXY_HOST, LOG_PROXY_PORT, LOG_PROXY_TYPE, LOG_QUERY_PARAM_PREFIX, LOG_READ_TIMEOUT_PREFIX, LOG_RESPONSE_HEADER_PREFIX, LOG_SCHEME, LOG_STATUS, LOG_URI, useCertificate, YCA_HTTP_HEADER
Constructor and Description |
---|
HTTPProviderSearcher(com.yahoo.component.ComponentId id,
List<Connection> connections,
HTTPParameters parameters,
com.yahoo.statistics.Statistics statistics)
Deprecated.
|
HTTPProviderSearcher(com.yahoo.component.ComponentId id,
List<Connection> connections,
HTTPParameters parameters,
com.yahoo.statistics.Statistics statistics,
com.yahoo.jdisc.http.CertificateStore certificateStore)
Deprecated.
Creates a provider searcher
|
HTTPProviderSearcher(com.yahoo.component.ComponentId id,
List<Connection> connections,
String path,
com.yahoo.statistics.Statistics statistics)
Deprecated.
|
HTTPProviderSearcher(com.yahoo.component.ComponentId id,
List<Connection> connections,
String path,
com.yahoo.statistics.Statistics statistics,
com.yahoo.jdisc.http.CertificateStore certificateStore)
Deprecated.
Creates a http provider searcher using id.getName as provider name
|
Modifier and Type | Method and Description |
---|---|
protected void |
addNonExcludedSourceProperties(Query query,
Map<String,String> queryMap)
Deprecated.
|
protected void |
configureCache(QrBinaryCacheConfig cacheConfig,
QrBinaryCacheRegionConfig regionConfig)
Deprecated.
this method does nothing
|
private Result |
consumeEntity(org.apache.http.HttpEntity entity,
Query query,
Result result,
Hit logHit,
long requestStartTime)
Deprecated.
|
abstract Map<String,String> |
getCacheKey(Query q)
Deprecated.
the cache key is ignored as there is no built-in caching support
|
Map<String,String> |
getQueryMap(Query query)
Deprecated.
Returns the key-value pairs that should be added as properties to the request url sent to the service.
|
protected Result |
inspectAndReturnFinalResult(Result result,
Hit requestMeta,
Exception e)
Deprecated.
Hook called at the moment the result is returned from this searcher.
|
protected void |
logResponseLatency(long latency)
Deprecated.
|
Result |
search(Query query,
Execution execution,
Connection connection)
Deprecated.
Perform the search against the given connection.
|
private Result |
statisticsBeforeInspection(Result result,
Hit requestMeta,
Exception e)
Deprecated.
|
void |
unmarshal(org.apache.http.HttpEntity entity,
Result result)
Deprecated.
Unmarshal the result from an http entity.
|
void |
unmarshal(InputStream stream,
long contentLength,
Result result)
Deprecated.
Unmarshal the stream by converting it to hits and adding the hits to the given result.
|
checkPing, cleanupHttpEntity, createClient, createMalformedUrlError, createRequest, createRequest, createRequestMeta, getConnectionManager, getEntity, getEntity, getParameters, getPath, getPingPath, getPingURI, getRequestEntity, getRequestHeaders, getResponse, getResponse, getResponse, getResponse, getURI, getURI, ping, shutdownConnectionManagers
deconstruct, failed, fill, fill, getFirstConnection, getHasher, getMonitor, log, ping, robustSearch, search, search, shouldRetry, timedOut, working
ping
ensureFilled, getLogger, process, toString
getAnnotatedDependencies, getDefaultAnnotatedDependencies, getDependencies, initDependencies
clone, compareTo, getClassName, getId, getIdString, hasInitializedId, initId, isDeconstructable, setIsDeconstructable
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
pingIterationCompleted
private final com.yahoo.statistics.Counter emptyResults
private final com.yahoo.statistics.Value hitsPerQuery
private final com.yahoo.statistics.Value responseLatency
private final com.yahoo.statistics.Counter readTimeouts
protected static final Logger log
protected String cacheName
public HTTPProviderSearcher(com.yahoo.component.ComponentId id, List<Connection> connections, String path, com.yahoo.statistics.Statistics statistics)
public HTTPProviderSearcher(com.yahoo.component.ComponentId id, List<Connection> connections, String path, com.yahoo.statistics.Statistics statistics, com.yahoo.jdisc.http.CertificateStore certificateStore)
public HTTPProviderSearcher(com.yahoo.component.ComponentId id, List<Connection> connections, HTTPParameters parameters, com.yahoo.statistics.Statistics statistics)
public HTTPProviderSearcher(com.yahoo.component.ComponentId id, List<Connection> connections, HTTPParameters parameters, com.yahoo.statistics.Statistics statistics, com.yahoo.jdisc.http.CertificateStore certificateStore)
id
- the id of this instanceconnections
- the connections this will load balance and fail over betweenparameters
- the parameters to use when making http calls@Deprecated protected void configureCache(QrBinaryCacheConfig cacheConfig, QrBinaryCacheRegionConfig regionConfig)
public void unmarshal(InputStream stream, long contentLength, Result result) throws IOException
unmarshal(entity,result).
Override this in subclasses which does not override unmarshal(entity,result).
This default implementation throws an exception.
stream
- the stream of data returnedcontentLength
- the length of the content in bytes if known, or a negative number if unknownresult
- the result to which unmarshalled data should be addedIOException
public void unmarshal(org.apache.http.HttpEntity entity, Result result) throws IOException
unmarshal(entity.getContent(), entity.getContentLength(), result)
(and does some detailed query tracing).entity
- the entity containing the data to unmarshalresult
- the result to which unmarshalled data should be addedIOException
protected void addNonExcludedSourceProperties(Query query, Map<String,String> queryMap)
protected Result inspectAndReturnFinalResult(Result result, Hit requestMeta, Exception e)
return result
.result
- the result which is to be returnedrequestMeta
- the request information hit, or null if none was created (e.g if this was a cache lookup)e
- the exception caused during execution of this query, or null if noneprivate Result statisticsBeforeInspection(Result result, Hit requestMeta, Exception e)
protected void logResponseLatency(long latency)
logResponseLatency
in class HTTPSearcher
public Result search(Query query, Execution execution, Connection connection)
ClusterSearcher
search
in class ClusterSearcher<Connection>
private Result consumeEntity(org.apache.http.HttpEntity entity, Query query, Result result, Hit logHit, long requestStartTime)
public Map<String,String> getQueryMap(Query query)
HTTPSearcher.getURI(com.yahoo.search.Query, com.yahoo.search.federation.http.Connection)
(from which this is called) is overridden.
This default implementation returns the query.properties() prefixed by
"source.[sourceName]" or "property.[propertyName]"
(by calling addNonExcludedSourceProperties(com.yahoo.search.Query, java.util.Map<java.lang.String, java.lang.String>)
).
getQueryMap
in class HTTPSearcher
@Deprecated public abstract Map<String,String> getCacheKey(Query q)
Copyright © 2018. All rights reserved.