public class FastSearcher extends VespaBackEndSearcher
VespaBackEndSearcher.FillHitsResult
Modifier and Type | Field and Description |
---|---|
private Backend |
dispatchBackend |
private static com.yahoo.processing.request.CompoundName |
dispatchCompression
The compression method which will be used with rpc dispatch.
|
private static com.yahoo.processing.request.CompoundName |
dispatchDirect
If this is turned on this will make search queries directly to the local search node when possible
|
private Dispatcher |
dispatcher
Used to dispatch directly to search nodes over RPC, replacing the old fnet communication path
|
private FS4ResourcePool |
fs4ResourcePool |
private String |
selfHostname |
cacheControl, PACKET_COMPRESSION_LIMIT, PACKET_COMPRESSION_TYPE, TRACE_DISABLE
Constructor and Description |
---|
FastSearcher(Backend dispatchBackend,
FS4ResourcePool fs4ResourcePool,
Dispatcher dispatcher,
SummaryParameters docSumParams,
ClusterParams clusterParams,
CacheParams cacheParams,
DocumentdbInfoConfig documentdbInfoConfig)
Creates a Fastsearcher.
|
Modifier and Type | Method and Description |
---|---|
private Backend |
chooseBackend(Query query)
Returns the backend object to issue a search request over.
|
private Packet[] |
convertBasicPackets(BasicPacket[] basicPackets) |
private int |
countFastHits(Result result) |
protected void |
doPartialFill(Result result,
String summaryClass)
Perform a partial docsum fill for a temporary result
representing a partition of the complete fill request.
|
Result |
doSearch2(Query query,
QueryPacket queryPacket,
CacheKey cacheKey,
Execution execution)
Searches a search cluster
This is an endpoint - searchers will never propagate the search to any nested searcher.
|
private CacheKey |
fetchCacheKeyFromHits(HitGroup hits,
String summaryClass) |
private Packet[] |
fetchSummaries(FS4Channel channel,
Result result,
String summaryClass) |
private void |
fillSDDocName(Result result)
Only used to fill the sddocname field when using direct dispatching as that is normally done in VespaBackEndSearcher.decodeSummary
|
private void |
forceSinglePassGrouping(GroupingOperation operation) |
private void |
forceSinglePassGrouping(Query query)
When we only search a single node, doing all grouping in one pass is more efficient
|
private DocsumPacketKey[] |
getPacketKeys(Result result,
String summaryClass,
boolean filled)
Returns an array of the hits contained in this result
|
protected boolean |
isLoggingFine() |
static Pong |
ping(Ping ping,
Backend backend,
String name) |
Pong |
ping(Ping ping,
Execution execution)
Pings the backend.
|
private static Optional<String> |
quotedSummaryClass(String summaryClass) |
private Result |
searchTwoPhase(FS4Channel channel,
Query query,
QueryPacket queryPacket,
CacheKey cacheKey) |
String |
toString()
Returns "searcher 'getId()'"
|
protected void |
transformQuery(Query query) |
addMetaInfo, addUnfilledHits, cacheLookupTwoPhase, ensureInstanceOf, fill, fillHits, getCacheControl, getDefaultDocsumClass, getDocsumDefinitionSet, getDocumentDatabase, getName, getSearcher, hitIterator, init, search, summaryNeedsQuery, traceQuery, wantsRPCSummaryFill
ensureFilled, getLogger, process
getAnnotatedDependencies, getDefaultAnnotatedDependencies, getDependencies, initDependencies
private static final com.yahoo.processing.request.CompoundName dispatchDirect
private static final com.yahoo.processing.request.CompoundName dispatchCompression
private final Dispatcher dispatcher
private final Backend dispatchBackend
private final FS4ResourcePool fs4ResourcePool
private final String selfHostname
public FastSearcher(Backend dispatchBackend, FS4ResourcePool fs4ResourcePool, Dispatcher dispatcher, SummaryParameters docSumParams, ClusterParams clusterParams, CacheParams cacheParams, DocumentdbInfoConfig documentdbInfoConfig)
dispatchBackend
- The backend object containing the connection to the dispatch node this should talk to
over the fs4 protocolfs4ResourcePool
- the resource pool used to create direct connections to the local search nodes when
bypassing the dispatch nodedispatcher
- the dispatcher used (when enabled) to send summary requests over the rpc protocol.
Eventually we will move everything to this protocol and never use dispatch nodes.
At that point we won't need a cluster searcher above this to select and pass the right
backend.docSumParams
- document summary parametersclusterParams
- the cluster number, and other cluster backend parameterscacheParams
- the size, lifetime, and controller of our cachedocumentdbInfoConfig
- document database parametersprivate int countFastHits(Result result)
public Pong ping(Ping ping, Execution execution)
ping
in class PingableSearcher
protected void transformQuery(Query query)
transformQuery
in class VespaBackEndSearcher
public Result doSearch2(Query query, QueryPacket queryPacket, CacheKey cacheKey, Execution execution)
VespaBackEndSearcher
doSearch2
in class VespaBackEndSearcher
query
- the query to searchqueryPacket
- the serialized query representation to pass to the search clustercacheKey
- the cache key created from the query packet, or null if caching is not usedexecution
- the query execution contextprivate void forceSinglePassGrouping(Query query)
private void forceSinglePassGrouping(GroupingOperation operation)
private Backend chooseBackend(Query query)
private void fillSDDocName(Result result)
result
- The resultprotected void doPartialFill(Result result, String summaryClass)
doPartialFill
in class VespaBackEndSearcher
result
- result containing a partition of the unfilled hitssummaryClass
- the summary class we want to fill withprivate Result searchTwoPhase(FS4Channel channel, Query query, QueryPacket queryPacket, CacheKey cacheKey) throws IOException
IOException
private Packet[] convertBasicPackets(BasicPacket[] basicPackets) throws ClassCastException
ClassCastException
private Packet[] fetchSummaries(FS4Channel channel, Result result, String summaryClass) throws InvalidChannelException, ChannelTimeoutException, ClassCastException, IOException
public String toString()
Searcher
private DocsumPacketKey[] getPacketKeys(Result result, String summaryClass, boolean filled)
filled
- true to return all hits, false to return only unfilled hitsprotected boolean isLoggingFine()
isLoggingFine
in class VespaBackEndSearcher
Copyright © 2018. All rights reserved.