Package com.yahoo.search.dispatch
Class SearchInvoker
- java.lang.Object
-
- com.yahoo.search.dispatch.CloseableInvoker
-
- com.yahoo.search.dispatch.SearchInvoker
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
- Direct Known Subclasses:
InterleavedSearchInvoker
,RpcSearchInvoker
,SearchErrorInvoker
public abstract class SearchInvoker extends CloseableInvoker
SearchInvoker encapsulates an allocated connection for running a single search query. The invocation object can be stateful and should not be reused.- Author:
- ollivir
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SearchInvoker(java.util.Optional<Node> node)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.util.Optional<java.lang.Integer>
distributionKey()
protected InvokerResult
errorResult(Query query, ErrorMessage errorMessage)
protected abstract InvokerResult
getSearchResult(Execution execution)
protected void
responseAvailable()
Result
search(Query query, Execution execution)
Retrieve the hits for the givenQuery
.protected abstract java.lang.Object
sendSearchRequest(Query query, java.lang.Object context)
protected void
setMonitor(ResponseMonitor<SearchInvoker> monitor)
-
Methods inherited from class com.yahoo.search.dispatch.CloseableInvoker
close, release, setFinalStatus, teardown
-
-
-
-
Constructor Detail
-
SearchInvoker
protected SearchInvoker(java.util.Optional<Node> node)
-
-
Method Detail
-
search
public Result search(Query query, Execution execution) throws java.io.IOException
Retrieve the hits for the givenQuery
. If the search is run on multiple content nodes, the providedExecution
may be used to retrieve document summaries required for correct result windowing.- Throws:
java.io.IOException
-
sendSearchRequest
protected abstract java.lang.Object sendSearchRequest(Query query, java.lang.Object context) throws java.io.IOException
- Parameters:
query
- the query to sendcontext
- a context object that can be used to pass context among different invokers, e.g for reuse of preserialized data.- Returns:
- an object that can be passed to the next invocation of sendSearchRequest
- Throws:
java.io.IOException
-
getSearchResult
protected abstract InvokerResult getSearchResult(Execution execution) throws java.io.IOException
- Throws:
java.io.IOException
-
setMonitor
protected void setMonitor(ResponseMonitor<SearchInvoker> monitor)
-
responseAvailable
protected void responseAvailable()
-
distributionKey
protected java.util.Optional<java.lang.Integer> distributionKey()
-
errorResult
protected InvokerResult errorResult(Query query, ErrorMessage errorMessage)
-
-