Package org.opensearch.node
Class MockNode
java.lang.Object
org.opensearch.node.Node
org.opensearch.node.MockNode
- All Implemented Interfaces:
java.io.Closeable,java.lang.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
-
Field Summary
-
Constructor Summary
Constructors Constructor Description MockNode(org.opensearch.common.settings.Settings settings, java.util.Collection<java.lang.Class<? extends org.opensearch.plugins.Plugin>> classpathPlugins)MockNode(org.opensearch.common.settings.Settings settings, java.util.Collection<java.lang.Class<? extends org.opensearch.plugins.Plugin>> classpathPlugins, boolean forbidPrivateIndexSettings)MockNode(org.opensearch.common.settings.Settings settings, java.util.Collection<java.lang.Class<? extends org.opensearch.plugins.Plugin>> classpathPlugins, java.nio.file.Path configPath, boolean forbidPrivateIndexSettings) -
Method Summary
Modifier and Type Method Description protected voidconfigureNodeAndClusterIdStateListener(org.opensearch.cluster.service.ClusterService clusterService)protected org.opensearch.common.util.BigArrayscreateBigArrays(org.opensearch.common.util.PageCacheRecycler pageCacheRecycler, org.opensearch.indices.breaker.CircuitBreakerService circuitBreakerService)java.util.Collection<java.lang.Class<? extends org.opensearch.plugins.Plugin>>getClasspathPlugins()The classpath plugins this node was constructed with.protected org.opensearch.cluster.ClusterInfoServicenewClusterInfoService(org.opensearch.common.settings.Settings settings, org.opensearch.cluster.service.ClusterService clusterService, org.opensearch.threadpool.ThreadPool threadPool, org.opensearch.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, java.util.Map<java.lang.String,org.opensearch.script.ScriptEngine> engines, java.util.Map<java.lang.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.fetch.FetchPhase fetchPhase, org.opensearch.node.ResponseCollectorService responseCollectorService, org.opensearch.indices.breaker.CircuitBreakerService circuitBreakerService)protected org.opensearch.transport.TransportServicenewTransportService(org.opensearch.common.settings.Settings settings, org.opensearch.transport.Transport transport, org.opensearch.threadpool.ThreadPool threadPool, org.opensearch.transport.TransportInterceptor interceptor, java.util.function.Function<org.opensearch.common.transport.BoundTransportAddress,org.opensearch.cluster.node.DiscoveryNode> localNodeFactory, org.opensearch.common.settings.ClusterSettings clusterSettings, java.util.Set<java.lang.String> taskHeaders)protected voidprocessRecoverySettings(org.opensearch.common.settings.ClusterSettings clusterSettings, org.opensearch.indices.recovery.RecoverySettings recoverySettings)
-
Constructor Details
-
MockNode
public MockNode(org.opensearch.common.settings.Settings settings, java.util.Collection<java.lang.Class<? extends org.opensearch.plugins.Plugin>> classpathPlugins) -
MockNode
public MockNode(org.opensearch.common.settings.Settings settings, java.util.Collection<java.lang.Class<? extends org.opensearch.plugins.Plugin>> classpathPlugins, boolean forbidPrivateIndexSettings) -
MockNode
public MockNode(org.opensearch.common.settings.Settings settings, java.util.Collection<java.lang.Class<? extends org.opensearch.plugins.Plugin>> classpathPlugins, java.nio.file.Path configPath, boolean forbidPrivateIndexSettings)
-
-
Method Details
-
getClasspathPlugins
public java.util.Collection<java.lang.Class<? extends org.opensearch.plugins.Plugin>> 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.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.fetch.FetchPhase fetchPhase, org.opensearch.node.ResponseCollectorService responseCollectorService, org.opensearch.indices.breaker.CircuitBreakerService circuitBreakerService)- Overrides:
newSearchServicein classorg.opensearch.node.Node
-
newScriptService
protected org.opensearch.script.ScriptService newScriptService(org.opensearch.common.settings.Settings settings, java.util.Map<java.lang.String,org.opensearch.script.ScriptEngine> engines, java.util.Map<java.lang.String,org.opensearch.script.ScriptContext<?>> contexts)- Overrides:
newScriptServicein classorg.opensearch.node.Node
-
newTransportService
protected org.opensearch.transport.TransportService newTransportService(org.opensearch.common.settings.Settings settings, org.opensearch.transport.Transport transport, org.opensearch.threadpool.ThreadPool threadPool, org.opensearch.transport.TransportInterceptor interceptor, java.util.function.Function<org.opensearch.common.transport.BoundTransportAddress,org.opensearch.cluster.node.DiscoveryNode> localNodeFactory, org.opensearch.common.settings.ClusterSettings clusterSettings, java.util.Set<java.lang.String> taskHeaders)- Overrides:
newTransportServicein classorg.opensearch.node.Node
-
processRecoverySettings
protected void processRecoverySettings(org.opensearch.common.settings.ClusterSettings clusterSettings, org.opensearch.indices.recovery.RecoverySettings recoverySettings)- Overrides:
processRecoverySettingsin 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.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
-