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
ConstructorsConstructorDescriptionInterleavedSearchInvoker(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 InvokerResultprotected LinkedBlockingQueue<SearchInvoker>newQueue()protected voidrelease()voidprotected ObjectsendSearchRequest(Query query, Object unusedContext) Sends search queries to the containedSearchInvokersub-invokers.protected voidsetMonitor(ResponseMonitor<SearchInvoker> monitor) Methods inherited from class com.yahoo.search.dispatch.SearchInvoker
distributionKey, errorResult, responseAvailable, searchMethods 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 containedSearchInvokersub-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:
sendSearchRequestin 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:
getSearchResultin classSearchInvoker- Throws:
IOException
-
release
protected void release()- Specified by:
releasein classCloseableInvoker
-
responseAvailable
- Specified by:
responseAvailablein interfaceResponseMonitor<SearchInvoker>
-
setMonitor
- Overrides:
setMonitorin classSearchInvoker
-
newQueue
-