Package org.elasticsearch.node
Class MockNode
- java.lang.Object
-
- org.elasticsearch.node.Node
-
- org.elasticsearch.node.MockNode
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class MockNode extends 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_DATA_SETTING, NODE_INGEST_SETTING, NODE_LOCAL_STORAGE_SETTING, NODE_MASTER_SETTING, NODE_NAME_SETTING, WRITE_PORTS_FILE_SETTING
-
-
Constructor Summary
Constructors Constructor Description MockNode(Settings settings, java.util.Collection<java.lang.Class<? extends Plugin>> classpathPlugins)
MockNode(Settings settings, java.util.Collection<java.lang.Class<? extends Plugin>> classpathPlugins, boolean forbidPrivateIndexSettings)
MockNode(Settings settings, java.util.Collection<java.lang.Class<? extends Plugin>> classpathPlugins, java.nio.file.Path configPath)
MockNode(Settings settings, java.util.Collection<java.lang.Class<? extends Plugin>> classpathPlugins, java.nio.file.Path configPath, boolean forbidPrivateIndexSettings)
MockNode(Environment environment, java.util.Collection<java.lang.Class<? extends Plugin>> classpathPlugins)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BigArrays
createBigArrays(PageCacheRecycler pageCacheRecycler, CircuitBreakerService circuitBreakerService)
java.util.Collection<java.lang.Class<? extends Plugin>>
getClasspathPlugins()
The classpath plugins this node was constructed with.protected ClusterInfoService
newClusterInfoService(Settings settings, ClusterService clusterService, ThreadPool threadPool, NodeClient client, java.util.function.Consumer<ClusterInfo> listener)
protected SearchService
newSearchService(ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ScriptService scriptService, BigArrays bigArrays, FetchPhase fetchPhase, ResponseCollectorService responseCollectorService)
protected TransportService
newTransportService(Settings settings, Transport transport, ThreadPool threadPool, TransportInterceptor interceptor, java.util.function.Function<BoundTransportAddress,DiscoveryNode> localNodeFactory, ClusterSettings clusterSettings, java.util.Set<java.lang.String> taskHeaders)
protected void
processRecoverySettings(ClusterSettings clusterSettings, RecoverySettings recoverySettings)
protected void
registerDerivedNodeNameWithLogger(java.lang.String nodeName)
-
Methods inherited from class org.elasticsearch.node.Node
client, close, createCircuitBreakerService, getEnvironment, getNodeEnvironment, getPluginsService, injector, isClosed, settings, start, validateNodeBeforeAcceptingRequests
-
-
-
-
Constructor Detail
-
MockNode
public MockNode(Settings settings, java.util.Collection<java.lang.Class<? extends Plugin>> classpathPlugins)
-
MockNode
public MockNode(Settings settings, java.util.Collection<java.lang.Class<? extends Plugin>> classpathPlugins, boolean forbidPrivateIndexSettings)
-
MockNode
public MockNode(Settings settings, java.util.Collection<java.lang.Class<? extends Plugin>> classpathPlugins, java.nio.file.Path configPath)
-
MockNode
public MockNode(Settings settings, java.util.Collection<java.lang.Class<? extends Plugin>> classpathPlugins, java.nio.file.Path configPath, boolean forbidPrivateIndexSettings)
-
MockNode
public MockNode(Environment environment, java.util.Collection<java.lang.Class<? extends Plugin>> classpathPlugins)
-
-
Method Detail
-
getClasspathPlugins
public java.util.Collection<java.lang.Class<? extends Plugin>> getClasspathPlugins()
The classpath plugins this node was constructed with.
-
createBigArrays
protected BigArrays createBigArrays(PageCacheRecycler pageCacheRecycler, CircuitBreakerService circuitBreakerService)
-
newSearchService
protected SearchService newSearchService(ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ScriptService scriptService, BigArrays bigArrays, FetchPhase fetchPhase, ResponseCollectorService responseCollectorService)
- Overrides:
newSearchService
in classNode
-
newTransportService
protected TransportService newTransportService(Settings settings, Transport transport, ThreadPool threadPool, TransportInterceptor interceptor, java.util.function.Function<BoundTransportAddress,DiscoveryNode> localNodeFactory, ClusterSettings clusterSettings, java.util.Set<java.lang.String> taskHeaders)
- Overrides:
newTransportService
in classNode
-
processRecoverySettings
protected void processRecoverySettings(ClusterSettings clusterSettings, RecoverySettings recoverySettings)
- Overrides:
processRecoverySettings
in classNode
-
newClusterInfoService
protected ClusterInfoService newClusterInfoService(Settings settings, ClusterService clusterService, ThreadPool threadPool, NodeClient client, java.util.function.Consumer<ClusterInfo> listener)
- Overrides:
newClusterInfoService
in classNode
-
registerDerivedNodeNameWithLogger
protected void registerDerivedNodeNameWithLogger(java.lang.String nodeName)
- Specified by:
registerDerivedNodeNameWithLogger
in classNode
-
-