Class InterleavedSearchInvoker

  • All Implemented Interfaces:
    ResponseMonitor<SearchInvoker>, java.io.Closeable, java.lang.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 Detail

      • InterleavedSearchInvoker

        public InterleavedSearchInvoker​(java.util.Collection<SearchInvoker> invokers,
                                        SearchCluster searchCluster,
                                        java.util.Set<java.lang.Integer> alreadyFailedNodes)
    • Method Detail

      • sendSearchRequest

        protected java.lang.Object sendSearchRequest​(Query query,
                                                     java.lang.Object unusedContext)
                                              throws java.io.IOException
        Sends search queries to the contained SearchInvoker 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 class SearchInvoker
        Parameters:
        query - the query to send
        unusedContext - 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
      • currentTime

        protected long currentTime()
      • newQueue

        protected java.util.concurrent.LinkedBlockingQueue<SearchInvoker> newQueue()