Package org.elasticsearch.node
Class MockNode
java.lang.Object
org.elasticsearch.node.Node
org.elasticsearch.node.MockNode
- All Implemented Interfaces:
Closeable,AutoCloseable
A node for testing which allows:
- Overriding Version.CURRENT
- Adding test plugins that exist on the classpath
- Swapping in various mock services
-
Field Summary
Fields inherited from class org.elasticsearch.node.Node
BREAKER_TYPE_KEY, INITIAL_STATE_TIMEOUT_SETTING, NODE_ATTRIBUTES, NODE_EXTERNAL_ID_SETTING, NODE_NAME_SETTING, WRITE_PORTS_FILE_SETTING -
Constructor Summary
ConstructorsConstructorDescriptionMockNode(Settings settings, Collection<Class<? extends Plugin>> classpathPlugins) MockNode(Settings settings, Collection<Class<? extends Plugin>> classpathPlugins, boolean forbidPrivateIndexSettings) MockNode(Settings settings, Collection<Class<? extends Plugin>> classpathPlugins, Path configPath, boolean forbidPrivateIndexSettings) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidconfigureNodeAndClusterIdStateListener(ClusterService clusterService) protected BigArrayscreateBigArrays(PageCacheRecycler pageCacheRecycler, CircuitBreakerService circuitBreakerService) Collection<Class<? extends Plugin>>The classpath plugins this node was constructed with.protected ClusterInfoServicenewClusterInfoService(Settings settings, ClusterService clusterService, ThreadPool threadPool, NodeClient client) protected HttpServerTransportnewHttpTransport(NetworkModule networkModule) protected ScriptServicenewScriptService(Settings settings, Map<String, ScriptEngine> engines, Map<String, ScriptContext<?>> contexts, LongSupplier timeProvider) protected SearchServicenewSearchService(ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ScriptService scriptService, BigArrays bigArrays, FetchPhase fetchPhase, ResponseCollectorService responseCollectorService, CircuitBreakerService circuitBreakerService, ExecutorSelector executorSelector, Tracer tracer) protected TransportServicenewTransportService(Settings settings, Transport transport, ThreadPool threadPool, TransportInterceptor interceptor, Function<BoundTransportAddress, DiscoveryNode> localNodeFactory, ClusterSettings clusterSettings, TaskManager taskManager, Tracer tracer) protected voidprocessRecoverySettings(ClusterSettings clusterSettings, RecoverySettings recoverySettings) Methods inherited from class org.elasticsearch.node.Node
awaitClose, client, close, deleteTemporaryApmConfig, getEnvironment, getNodeEnvironment, getPluginsService, injector, isClosed, prepareForClose, settings, start, validateNodeBeforeAcceptingRequests
-
Constructor Details
-
MockNode
-
MockNode
public MockNode(Settings settings, Collection<Class<? extends Plugin>> classpathPlugins, boolean forbidPrivateIndexSettings) -
MockNode
public MockNode(Settings settings, Collection<Class<? extends Plugin>> classpathPlugins, Path configPath, boolean forbidPrivateIndexSettings)
-
-
Method Details
-
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, CircuitBreakerService circuitBreakerService, ExecutorSelector executorSelector, Tracer tracer) - Overrides:
newSearchServicein classNode
-
newScriptService
protected ScriptService newScriptService(Settings settings, Map<String, ScriptEngine> engines, Map<String, ScriptContext<?>> contexts, LongSupplier timeProvider) - Overrides:
newScriptServicein classNode
-
newTransportService
protected TransportService newTransportService(Settings settings, Transport transport, ThreadPool threadPool, TransportInterceptor interceptor, Function<BoundTransportAddress, DiscoveryNode> localNodeFactory, ClusterSettings clusterSettings, TaskManager taskManager, Tracer tracer) - Overrides:
newTransportServicein classNode
-
processRecoverySettings
protected void processRecoverySettings(ClusterSettings clusterSettings, RecoverySettings recoverySettings) - Overrides:
processRecoverySettingsin classNode
-
newClusterInfoService
protected ClusterInfoService newClusterInfoService(Settings settings, ClusterService clusterService, ThreadPool threadPool, NodeClient client) - Overrides:
newClusterInfoServicein classNode
-
newHttpTransport
- Overrides:
newHttpTransportin classNode
-
configureNodeAndClusterIdStateListener
- Overrides:
configureNodeAndClusterIdStateListenerin classNode
-
getNamedWriteableRegistry
-