Class MockNode
java.lang.Object
org.opensearch.node.Node
org.opensearch.node.MockNode
- All Implemented Interfaces:
Closeable,AutoCloseable
public class MockNode
extends org.opensearch.node.Node
A node for testing which allows:
- Overriding Version.CURRENT
- Adding test plugins that exist on the classpath
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opensearch.node.Node
org.opensearch.node.Node.CustomForkJoinWorkerThread, org.opensearch.node.Node.DiscoverySettings -
Field Summary
Fields inherited from class org.opensearch.node.Node
BREAKER_TYPE_KEY, NODE_ATTRIBUTES, NODE_LOCAL_STORAGE_SETTING, NODE_NAME_SETTING, NODE_SEARCH_CACHE_SIZE_SETTING, WRITE_PORTS_FILE_SETTING -
Constructor Summary
ConstructorsConstructorDescriptionMockNode(org.opensearch.common.settings.Settings settings, Collection<Class<? extends org.opensearch.plugins.Plugin>> classpathPlugins) MockNode(org.opensearch.common.settings.Settings settings, Collection<org.opensearch.plugins.PluginInfo> classpathPlugins, Path configPath, boolean forbidPrivateIndexSettings) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidconfigureNodeAndClusterIdStateListener(org.opensearch.cluster.service.ClusterService clusterService) protected org.opensearch.common.util.BigArrayscreateBigArrays(org.opensearch.common.util.PageCacheRecycler pageCacheRecycler, org.opensearch.core.indices.breaker.CircuitBreakerService circuitBreakerService) Collection<org.opensearch.plugins.PluginInfo> The classpath plugins this node was constructed with.org.opensearch.core.common.io.stream.NamedWriteableRegistryprotected org.opensearch.cluster.ClusterInfoServicenewClusterInfoService(org.opensearch.common.settings.Settings settings, org.opensearch.cluster.service.ClusterService clusterService, org.opensearch.threadpool.ThreadPool threadPool, org.opensearch.transport.client.node.NodeClient client) protected org.opensearch.http.HttpServerTransportnewHttpTransport(org.opensearch.common.network.NetworkModule networkModule) protected org.opensearch.script.ScriptServicenewScriptService(org.opensearch.common.settings.Settings settings, Map<String, org.opensearch.script.ScriptEngine> engines, Map<String, org.opensearch.script.ScriptContext<?>> contexts) protected org.opensearch.search.SearchServicenewSearchService(org.opensearch.cluster.service.ClusterService clusterService, org.opensearch.indices.IndicesService indicesService, org.opensearch.threadpool.ThreadPool threadPool, org.opensearch.script.ScriptService scriptService, org.opensearch.common.util.BigArrays bigArrays, org.opensearch.search.query.QueryPhase queryPhase, org.opensearch.search.fetch.FetchPhase fetchPhase, org.opensearch.node.ResponseCollectorService responseCollectorService, org.opensearch.core.indices.breaker.CircuitBreakerService circuitBreakerService, Executor indexSearcherExecutor, org.opensearch.tasks.TaskResourceTrackingService taskResourceTrackingService, Collection<org.opensearch.search.deciders.ConcurrentSearchRequestDecider.Factory> concurrentSearchDeciderFactories, List<org.opensearch.plugins.SearchPlugin.ProfileMetricsProvider> pluginProfilers) protected org.opensearch.transport.TransportServicenewTransportService(org.opensearch.common.settings.Settings settings, org.opensearch.transport.Transport transport, org.opensearch.transport.Transport streamTransport, org.opensearch.threadpool.ThreadPool threadPool, org.opensearch.transport.TransportInterceptor interceptor, Function<org.opensearch.core.common.transport.BoundTransportAddress, org.opensearch.cluster.node.DiscoveryNode> localNodeFactory, org.opensearch.common.settings.ClusterSettings clusterSettings, Set<String> taskHeaders, org.opensearch.telemetry.tracing.Tracer tracer) Methods inherited from class org.opensearch.node.Node
awaitClose, client, close, createCircuitBreakerService, fileCache, getEnvironment, getNodeEnvironment, getPluginsService, injector, isClosed, newAuxTransports, settings, start, validateNodeBeforeAcceptingRequests
-
Constructor Details
-
MockNode
public MockNode(org.opensearch.common.settings.Settings settings, Collection<org.opensearch.plugins.PluginInfo> classpathPlugins, Path configPath, boolean forbidPrivateIndexSettings) -
MockNode
public MockNode(org.opensearch.common.settings.Settings settings, Collection<Class<? extends org.opensearch.plugins.Plugin>> classpathPlugins)
-
-
Method Details
-
getClasspathPlugins
The classpath plugins this node was constructed with. -
createBigArrays
protected org.opensearch.common.util.BigArrays createBigArrays(org.opensearch.common.util.PageCacheRecycler pageCacheRecycler, org.opensearch.core.indices.breaker.CircuitBreakerService circuitBreakerService) -
newSearchService
protected org.opensearch.search.SearchService newSearchService(org.opensearch.cluster.service.ClusterService clusterService, org.opensearch.indices.IndicesService indicesService, org.opensearch.threadpool.ThreadPool threadPool, org.opensearch.script.ScriptService scriptService, org.opensearch.common.util.BigArrays bigArrays, org.opensearch.search.query.QueryPhase queryPhase, org.opensearch.search.fetch.FetchPhase fetchPhase, org.opensearch.node.ResponseCollectorService responseCollectorService, org.opensearch.core.indices.breaker.CircuitBreakerService circuitBreakerService, Executor indexSearcherExecutor, org.opensearch.tasks.TaskResourceTrackingService taskResourceTrackingService, Collection<org.opensearch.search.deciders.ConcurrentSearchRequestDecider.Factory> concurrentSearchDeciderFactories, List<org.opensearch.plugins.SearchPlugin.ProfileMetricsProvider> pluginProfilers) - Overrides:
newSearchServicein classorg.opensearch.node.Node
-
newScriptService
-
newTransportService
protected org.opensearch.transport.TransportService newTransportService(org.opensearch.common.settings.Settings settings, org.opensearch.transport.Transport transport, @Nullable org.opensearch.transport.Transport streamTransport, org.opensearch.threadpool.ThreadPool threadPool, org.opensearch.transport.TransportInterceptor interceptor, Function<org.opensearch.core.common.transport.BoundTransportAddress, org.opensearch.cluster.node.DiscoveryNode> localNodeFactory, org.opensearch.common.settings.ClusterSettings clusterSettings, Set<String> taskHeaders, org.opensearch.telemetry.tracing.Tracer tracer) - Overrides:
newTransportServicein classorg.opensearch.node.Node
-
newClusterInfoService
protected org.opensearch.cluster.ClusterInfoService newClusterInfoService(org.opensearch.common.settings.Settings settings, org.opensearch.cluster.service.ClusterService clusterService, org.opensearch.threadpool.ThreadPool threadPool, org.opensearch.transport.client.node.NodeClient client) - Overrides:
newClusterInfoServicein classorg.opensearch.node.Node
-
newHttpTransport
protected org.opensearch.http.HttpServerTransport newHttpTransport(org.opensearch.common.network.NetworkModule networkModule) - Overrides:
newHttpTransportin classorg.opensearch.node.Node
-
configureNodeAndClusterIdStateListener
protected void configureNodeAndClusterIdStateListener(org.opensearch.cluster.service.ClusterService clusterService) - Overrides:
configureNodeAndClusterIdStateListenerin classorg.opensearch.node.Node
-
getNamedWriteableRegistry
public org.opensearch.core.common.io.stream.NamedWriteableRegistry getNamedWriteableRegistry()
-