Class MockSearchService

java.lang.Object
org.elasticsearch.common.component.AbstractLifecycleComponent
org.elasticsearch.search.SearchService
org.elasticsearch.search.MockSearchService
All Implemented Interfaces:
java.io.Closeable, java.lang.AutoCloseable, org.elasticsearch.common.component.LifecycleComponent, org.elasticsearch.common.lease.Releasable, org.elasticsearch.index.shard.IndexEventListener

public class MockSearchService
extends org.elasticsearch.search.SearchService
  • Nested Class Summary

    Nested Classes
    Modifier and Type Class Description
    static class  MockSearchService.TestPlugin
    Marker plugin used by MockNode to enable MockSearchService.

    Nested classes/interfaces inherited from class org.elasticsearch.search.SearchService

    org.elasticsearch.search.SearchService.CanMatchResponse
  • 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, KEEPALIVE_INTERVAL_SETTING, LOW_LEVEL_CANCELLATION_SETTING, MAX_KEEPALIVE_SETTING, MAX_OPEN_SCROLL_CONTEXT, NO_TIMEOUT

    Fields inherited from class org.elasticsearch.common.component.AbstractLifecycleComponent

    lifecycle
  • Constructor Summary

    Constructors
    Constructor Description
    MockSearchService​(org.elasticsearch.cluster.service.ClusterService clusterService, org.elasticsearch.indices.IndicesService indicesService, org.elasticsearch.threadpool.ThreadPool threadPool, org.elasticsearch.script.ScriptService scriptService, org.elasticsearch.common.util.BigArrays bigArrays, org.elasticsearch.search.fetch.FetchPhase fetchPhase, org.elasticsearch.indices.breaker.CircuitBreakerService circuitBreakerService)  
  • Method Summary

    Modifier and Type Method Description
    static void assertNoInFlightContext()
    Throw an AssertionError if there are still in-flight contexts.
    protected void putReaderContext​(org.elasticsearch.search.internal.ReaderContext context)  
    protected org.elasticsearch.search.internal.ReaderContext removeReaderContext​(long id)  
    void setOnPutContext​(java.util.function.Consumer<org.elasticsearch.search.internal.ReaderContext> onPutContext)  

    Methods inherited from class org.elasticsearch.search.SearchService

    afterIndexRemoved, aggReduceContextBuilder, buildAliasFilter, canMatch, canMatch, canRewriteToMatchNone, createSearchContext, defaultAllowPartialSearchResults, doClose, doStart, doStop, executeDfsPhase, executeFetchPhase, executeFetchPhase, executeQueryPhase, executeQueryPhase, executeQueryPhase, freeAllScrollContexts, freeReaderContext, getActiveContexts, getCoordinatorRewriteContextProvider, getIndicesService, getResponseCollectorService, getRewriteContext, openReaderContext, queryStillMatchesAfterRewrite

    Methods inherited from class org.elasticsearch.common.component.AbstractLifecycleComponent

    addLifecycleListener, close, lifecycleState, removeLifecycleListener, 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

    afterIndexCreated, afterIndexShardClosed, afterIndexShardCreated, afterIndexShardDeleted, afterIndexShardStarted, beforeIndexAddedToCluster, beforeIndexCreated, beforeIndexRemoved, beforeIndexShardClosed, beforeIndexShardCreated, beforeIndexShardDeleted, beforeIndexShardRecovery, indexShardStateChanged, onShardInactive, onStoreClosed, onStoreCreated, shardRoutingChanged
  • Constructor Details

    • MockSearchService

      public MockSearchService​(org.elasticsearch.cluster.service.ClusterService clusterService, org.elasticsearch.indices.IndicesService indicesService, org.elasticsearch.threadpool.ThreadPool threadPool, org.elasticsearch.script.ScriptService scriptService, org.elasticsearch.common.util.BigArrays bigArrays, org.elasticsearch.search.fetch.FetchPhase fetchPhase, org.elasticsearch.indices.breaker.CircuitBreakerService circuitBreakerService)
  • Method Details

    • assertNoInFlightContext

      public static void assertNoInFlightContext()
      Throw an AssertionError if there are still in-flight contexts.
    • putReaderContext

      protected void putReaderContext​(org.elasticsearch.search.internal.ReaderContext context)
      Overrides:
      putReaderContext in class org.elasticsearch.search.SearchService
    • removeReaderContext

      protected org.elasticsearch.search.internal.ReaderContext removeReaderContext​(long id)
      Overrides:
      removeReaderContext in class org.elasticsearch.search.SearchService
    • setOnPutContext

      public void setOnPutContext​(java.util.function.Consumer<org.elasticsearch.search.internal.ReaderContext> onPutContext)