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
Modifier and TypeClassDescriptionstatic class
Marker plugin used byMockNode
to enableMockSearchService
.Nested classes/interfaces inherited from class org.elasticsearch.search.SearchService
SearchService.ResultsType
-
Field Summary
Fields inherited from class org.elasticsearch.search.SearchService
ALLOW_EXPENSIVE_QUERIES, CCS_VERSION_CHECK_SETTING, 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, MINIMUM_DOCS_PER_SLICE, NO_TIMEOUT, QUERY_PHASE_PARALLEL_COLLECTION_ENABLED, SEARCH_WORKER_THREADS_ENABLED
Fields inherited from class org.elasticsearch.common.component.AbstractLifecycleComponent
lifecycle
-
Constructor Summary
ConstructorDescriptionMockSearchService
(ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ScriptService scriptService, BigArrays bigArrays, FetchPhase fetchPhase, ResponseCollectorService responseCollectorService, CircuitBreakerService circuitBreakerService, ExecutorSelector executorSelector, Tracer tracer) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Throw anAssertionError
if there are still in-flight contexts.protected void
protected SearchContext
createContext
(ReaderContext readerContext, ShardSearchRequest request, SearchShardTask task, SearchService.ResultsType resultsType, boolean includeAggregations) protected void
putReaderContext
(ReaderContext context) protected ReaderContext
removeReaderContext
(long id) void
setOnCheckCancelled
(Function<SearchShardTask, SearchShardTask> onCheckCancelled) void
setOnCreateSearchContext
(Consumer<SearchContext> onCreateSearchContext) void
setOnPutContext
(Consumer<ReaderContext> onPutContext) Methods inherited from class org.elasticsearch.search.SearchService
afterIndexRemoved, aggReduceContextBuilder, beforeIndexShardCreated, buildAliasFilter, canMatch, canMatch, canRewriteToMatchNone, createSearchContext, defaultAllowPartialSearchResults, doClose, doStart, doStop, executeDfsPhase, executeFetchPhase, executeFetchPhase, executeQueryPhase, executeQueryPhase, executeQueryPhase, freeAllScrollContexts, freeReaderContext, getActiveContexts, getCoordinatorRewriteContextProvider, getIndicesService, getOpenScrollContexts, getResponseCollectorService, getRewriteContext, openReaderContext, queryStillMatchesAfterRewrite
Methods inherited from class org.elasticsearch.common.component.AbstractLifecycleComponent
addLifecycleListener, close, lifecycleState, start, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.elasticsearch.index.shard.IndexEventListener
afterFilesRestoredFromRepository, afterIndexCreated, afterIndexShardClosed, afterIndexShardCreated, afterIndexShardDeleted, afterIndexShardRecovery, afterIndexShardStarted, beforeIndexAddedToCluster, beforeIndexCreated, beforeIndexRemoved, beforeIndexShardClosed, beforeIndexShardDeleted, beforeIndexShardRecovery, indexShardStateChanged, 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, Tracer tracer)
-
-
Method Details
-
assertNoInFlightContext
public static void assertNoInFlightContext()Throw anAssertionError
if there are still in-flight contexts. -
putReaderContext
- Overrides:
putReaderContext
in classSearchService
-
removeReaderContext
- Overrides:
removeReaderContext
in classSearchService
-
setOnPutContext
-
setOnCreateSearchContext
-
createContext
protected SearchContext createContext(ReaderContext readerContext, ShardSearchRequest request, SearchShardTask task, SearchService.ResultsType resultsType, boolean includeAggregations) throws IOException - Overrides:
createContext
in classSearchService
- Throws:
IOException
-
setOnCheckCancelled
-
checkCancelled
- Overrides:
checkCancelled
in classSearchService
-