Package org.elasticsearch.search
Class MockSearchService
java.lang.Object
org.elasticsearch.common.component.AbstractLifecycleComponent
org.elasticsearch.search.SearchService
org.elasticsearch.search.MockSearchService
- All Implemented Interfaces:
Closeable,AutoCloseable,LifecycleComponent,org.elasticsearch.core.Releasable,IndexEventListener
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classMarker plugin used byMockNodeto enableMockSearchService. -
Field Summary
Fields inherited from class org.elasticsearch.search.SearchService
ALLOW_EXPENSIVE_QUERIES, DEFAULT_ALLOW_PARTIAL_SEARCH_RESULTS, DEFAULT_FROM, DEFAULT_KEEPALIVE_SETTING, DEFAULT_SEARCH_TIMEOUT_SETTING, DEFAULT_SIZE, ENABLE_REWRITE_AGGS_TO_FILTER_BY_FILTER, KEEPALIVE_INTERVAL_SETTING, LOW_LEVEL_CANCELLATION_SETTING, MAX_ASYNC_SEARCH_RESPONSE_SIZE_SETTING, MAX_KEEPALIVE_SETTING, MAX_OPEN_SCROLL_CONTEXT, NO_TIMEOUTFields inherited from class org.elasticsearch.common.component.AbstractLifecycleComponent
lifecycle -
Constructor Summary
ConstructorsConstructorDescriptionMockSearchService(ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ScriptService scriptService, BigArrays bigArrays, FetchPhase fetchPhase, ResponseCollectorService responseCollectorService, CircuitBreakerService circuitBreakerService, ExecutorSelector executorSelector) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidThrow anAssertionErrorif there are still in-flight contexts.protected voidprotected SearchContextcreateContext(ReaderContext readerContext, ShardSearchRequest request, SearchShardTask task, boolean includeAggregations) protected voidputReaderContext(ReaderContext context) protected ReaderContextremoveReaderContext(long id) voidsetOnCheckCancelled(Function<SearchShardTask, SearchShardTask> onCheckCancelled) voidsetOnCreateSearchContext(Consumer<SearchContext> onCreateSearchContext) voidsetOnPutContext(Consumer<ReaderContext> onPutContext) Methods inherited from class org.elasticsearch.search.SearchService
afterIndexRemoved, aggReduceContextBuilder, beforeIndexShardCreated, buildAliasFilter, canMatch, canMatch, canMatch, canRewriteToMatchNone, createSearchContext, defaultAllowPartialSearchResults, doClose, doStart, doStop, executeDfsPhase, executeFetchPhase, executeFetchPhase, executeQueryPhase, executeQueryPhase, executeQueryPhase, freeAllScrollContexts, freeReaderContext, getActiveContexts, getCoordinatorRewriteContextProvider, getIndicesService, getOpenScrollContexts, getResponseCollectorService, getRewriteContext, openReaderContext, queryStillMatchesAfterRewriteMethods inherited from class org.elasticsearch.common.component.AbstractLifecycleComponent
addLifecycleListener, close, lifecycleState, removeLifecycleListener, start, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.index.shard.IndexEventListener
afterIndexCreated, afterIndexShardClosed, afterIndexShardCreated, afterIndexShardDeleted, afterIndexShardStarted, beforeIndexAddedToCluster, beforeIndexCreated, beforeIndexRemoved, beforeIndexShardClosed, beforeIndexShardDeleted, beforeIndexShardRecovery, indexShardStateChanged, onShardInactive, onStoreClosed, onStoreCreated, shardRoutingChanged
-
Constructor Details
-
MockSearchService
public MockSearchService(ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ScriptService scriptService, BigArrays bigArrays, FetchPhase fetchPhase, ResponseCollectorService responseCollectorService, CircuitBreakerService circuitBreakerService, ExecutorSelector executorSelector)
-
-
Method Details
-
assertNoInFlightContext
public static void assertNoInFlightContext()Throw anAssertionErrorif there are still in-flight contexts. -
putReaderContext
- Overrides:
putReaderContextin classSearchService
-
removeReaderContext
- Overrides:
removeReaderContextin classSearchService
-
setOnPutContext
-
setOnCreateSearchContext
-
createContext
protected SearchContext createContext(ReaderContext readerContext, ShardSearchRequest request, SearchShardTask task, boolean includeAggregations) throws IOException - Overrides:
createContextin classSearchService- Throws:
IOException
-
setOnCheckCancelled
-
checkCancelled
- Overrides:
checkCancelledin classSearchService
-