Package com.yahoo.search.dispatch
Class InterleavedSearchInvoker
java.lang.Object
com.yahoo.search.dispatch.CloseableInvoker
com.yahoo.search.dispatch.SearchInvoker
com.yahoo.search.dispatch.InterleavedSearchInvoker
- All Implemented Interfaces:
ResponseMonitor<SearchInvoker>
,Closeable
,AutoCloseable
public class InterleavedSearchInvoker
extends SearchInvoker
implements ResponseMonitor<SearchInvoker>
InterleavedSearchInvoker uses multiple
SearchInvoker
objects to interface with content
nodes in parallel. Operationally it first sends requests to all contained invokers and then
collects the results. The user of this class is responsible for merging the results if needed.- Author:
- ollivir
-
Constructor Summary
ConstructorDescriptionInterleavedSearchInvoker
(com.yahoo.concurrent.Timer timer, Collection<SearchInvoker> invokers, TopKEstimator hitEstimator, com.yahoo.vespa.config.search.DispatchConfig dispatchConfig, Group group, Set<Integer> alreadyFailedNodes) -
Method Summary
Modifier and TypeMethodDescriptionprotected InvokerResult
protected LinkedBlockingQueue<SearchInvoker>
newQueue()
protected void
release()
void
protected Object
sendSearchRequest
(Query query, Object unusedContext) Sends search queries to the containedSearchInvoker
sub-invokers.protected void
setMonitor
(ResponseMonitor<SearchInvoker> monitor) Methods inherited from class com.yahoo.search.dispatch.SearchInvoker
distributionKey, errorResult, responseAvailable, search
Methods inherited from class com.yahoo.search.dispatch.CloseableInvoker
close, setFinalStatus, teardown
-
Constructor Details
-
InterleavedSearchInvoker
public InterleavedSearchInvoker(com.yahoo.concurrent.Timer timer, Collection<SearchInvoker> invokers, TopKEstimator hitEstimator, com.yahoo.vespa.config.search.DispatchConfig dispatchConfig, Group group, Set<Integer> alreadyFailedNodes)
-
-
Method Details
-
sendSearchRequest
Sends search queries to the containedSearchInvoker
sub-invokers. If the search query has an offset other than zero, it will be reset to zero and the expected hit amount will be adjusted accordingly.- Specified by:
sendSearchRequest
in classSearchInvoker
- Parameters:
query
- the query to sendunusedContext
- 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:
IOException
-
getSearchResult
- Specified by:
getSearchResult
in classSearchInvoker
- Throws:
IOException
-
release
protected void release()- Specified by:
release
in classCloseableInvoker
-
responseAvailable
- Specified by:
responseAvailable
in interfaceResponseMonitor<SearchInvoker>
-
setMonitor
- Overrides:
setMonitor
in classSearchInvoker
-
newQueue
-