Package org.elasticsearch.node
Class MockNode
java.lang.Object
org.elasticsearch.node.Node
org.elasticsearch.node.MockNode
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class MockNode
extends org.elasticsearch.node.Node
A node for testing which allows:
- Overriding Version.CURRENT
- Adding test plugins that exist on the classpath
-
Field Summary
Fields inherited from class org.elasticsearch.node.Node
BREAKER_TYPE_KEY, NODE_ATTRIBUTES, NODE_LOCAL_STORAGE_SETTING, NODE_NAME_SETTING, WRITE_PORTS_FILE_SETTING
-
Constructor Summary
ConstructorsConstructorDescriptionMockNode(org.elasticsearch.common.settings.Settings settings, Collection<Class<? extends org.elasticsearch.plugins.Plugin>> classpathPlugins)
MockNode(org.elasticsearch.common.settings.Settings settings, Collection<Class<? extends org.elasticsearch.plugins.Plugin>> classpathPlugins, boolean forbidPrivateIndexSettings)
MockNode(org.elasticsearch.common.settings.Settings settings, Collection<Class<? extends org.elasticsearch.plugins.Plugin>> classpathPlugins, Path configPath, boolean forbidPrivateIndexSettings)
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
configureNodeAndClusterIdStateListener(org.elasticsearch.cluster.service.ClusterService clusterService)
protected org.elasticsearch.common.util.BigArrays
createBigArrays(org.elasticsearch.common.util.PageCacheRecycler pageCacheRecycler, org.elasticsearch.indices.breaker.CircuitBreakerService circuitBreakerService)
Collection<Class<? extends org.elasticsearch.plugins.Plugin>>
The classpath plugins this node was constructed with.protected org.elasticsearch.cluster.ClusterInfoService
newClusterInfoService(org.elasticsearch.common.settings.Settings settings, org.elasticsearch.cluster.service.ClusterService clusterService, org.elasticsearch.threadpool.ThreadPool threadPool, org.elasticsearch.client.node.NodeClient client)
protected org.elasticsearch.http.HttpServerTransport
newHttpTransport(org.elasticsearch.common.network.NetworkModule networkModule)
protected org.elasticsearch.script.ScriptService
newScriptService(org.elasticsearch.common.settings.Settings settings, Map<String,org.elasticsearch.script.ScriptEngine> engines, Map<String,org.elasticsearch.script.ScriptContext<?>> contexts)
protected org.elasticsearch.search.SearchService
newSearchService(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.node.ResponseCollectorService responseCollectorService, org.elasticsearch.indices.breaker.CircuitBreakerService circuitBreakerService, org.elasticsearch.indices.ExecutorSelector executorSelector)
protected org.elasticsearch.transport.TransportService
newTransportService(org.elasticsearch.common.settings.Settings settings, org.elasticsearch.transport.Transport transport, org.elasticsearch.threadpool.ThreadPool threadPool, org.elasticsearch.transport.TransportInterceptor interceptor, Function<org.elasticsearch.common.transport.BoundTransportAddress,org.elasticsearch.cluster.node.DiscoveryNode> localNodeFactory, org.elasticsearch.common.settings.ClusterSettings clusterSettings, Set<String> taskHeaders)
protected void
processRecoverySettings(org.elasticsearch.common.settings.ClusterSettings clusterSettings, org.elasticsearch.indices.recovery.RecoverySettings recoverySettings)
Methods inherited from class org.elasticsearch.node.Node
awaitClose, client, close, createCircuitBreakerService, getEnvironment, getNodeEnvironment, getPluginsService, injector, isClosed, settings, start, validateNodeBeforeAcceptingRequests
-
Constructor Details
-
MockNode
public MockNode(org.elasticsearch.common.settings.Settings settings, Collection<Class<? extends org.elasticsearch.plugins.Plugin>> classpathPlugins) -
MockNode
public MockNode(org.elasticsearch.common.settings.Settings settings, Collection<Class<? extends org.elasticsearch.plugins.Plugin>> classpathPlugins, boolean forbidPrivateIndexSettings) -
MockNode
public MockNode(org.elasticsearch.common.settings.Settings settings, Collection<Class<? extends org.elasticsearch.plugins.Plugin>> classpathPlugins, Path configPath, boolean forbidPrivateIndexSettings)
-
-
Method Details
-
getClasspathPlugins
The classpath plugins this node was constructed with. -
createBigArrays
protected org.elasticsearch.common.util.BigArrays createBigArrays(org.elasticsearch.common.util.PageCacheRecycler pageCacheRecycler, org.elasticsearch.indices.breaker.CircuitBreakerService circuitBreakerService) -
newSearchService
protected org.elasticsearch.search.SearchService newSearchService(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.node.ResponseCollectorService responseCollectorService, org.elasticsearch.indices.breaker.CircuitBreakerService circuitBreakerService, org.elasticsearch.indices.ExecutorSelector executorSelector)- Overrides:
newSearchService
in classorg.elasticsearch.node.Node
-
newScriptService
protected org.elasticsearch.script.ScriptService newScriptService(org.elasticsearch.common.settings.Settings settings, Map<String,org.elasticsearch.script.ScriptEngine> engines, Map<String,org.elasticsearch.script.ScriptContext<?>> contexts)- Overrides:
newScriptService
in classorg.elasticsearch.node.Node
-
newTransportService
protected org.elasticsearch.transport.TransportService newTransportService(org.elasticsearch.common.settings.Settings settings, org.elasticsearch.transport.Transport transport, org.elasticsearch.threadpool.ThreadPool threadPool, org.elasticsearch.transport.TransportInterceptor interceptor, Function<org.elasticsearch.common.transport.BoundTransportAddress,org.elasticsearch.cluster.node.DiscoveryNode> localNodeFactory, org.elasticsearch.common.settings.ClusterSettings clusterSettings, Set<String> taskHeaders)- Overrides:
newTransportService
in classorg.elasticsearch.node.Node
-
processRecoverySettings
protected void processRecoverySettings(org.elasticsearch.common.settings.ClusterSettings clusterSettings, org.elasticsearch.indices.recovery.RecoverySettings recoverySettings)- Overrides:
processRecoverySettings
in classorg.elasticsearch.node.Node
-
newClusterInfoService
protected org.elasticsearch.cluster.ClusterInfoService newClusterInfoService(org.elasticsearch.common.settings.Settings settings, org.elasticsearch.cluster.service.ClusterService clusterService, org.elasticsearch.threadpool.ThreadPool threadPool, org.elasticsearch.client.node.NodeClient client)- Overrides:
newClusterInfoService
in classorg.elasticsearch.node.Node
-
newHttpTransport
protected org.elasticsearch.http.HttpServerTransport newHttpTransport(org.elasticsearch.common.network.NetworkModule networkModule)- Overrides:
newHttpTransport
in classorg.elasticsearch.node.Node
-
configureNodeAndClusterIdStateListener
protected void configureNodeAndClusterIdStateListener(org.elasticsearch.cluster.service.ClusterService clusterService)- Overrides:
configureNodeAndClusterIdStateListener
in classorg.elasticsearch.node.Node
-