public class Node
extends java.lang.Object
implements java.io.Closeable
Modifier and Type | Field and Description |
---|---|
static Setting<java.lang.String> |
BREAKER_TYPE_KEY |
static Setting<Settings> |
NODE_ATTRIBUTES |
static Setting<java.lang.Boolean> |
NODE_DATA_SETTING |
static Setting<java.lang.Boolean> |
NODE_INGEST_SETTING |
static Setting<java.lang.Boolean> |
NODE_LOCAL_STORAGE_SETTING
controls whether the node is allowed to persist things like metadata to disk
Note that this does not control whether the node stores actual indices (see
NODE_DATA_SETTING ). |
static Setting<java.lang.Boolean> |
NODE_MASTER_SETTING |
static Setting<java.lang.String> |
NODE_NAME_SETTING |
static Setting<java.lang.Boolean> |
WRITE_PORTS_FILE_SETTING |
Modifier | Constructor and Description |
---|---|
|
Node(Environment environment) |
protected |
Node(Environment environment,
java.util.Collection<java.lang.Class<? extends Plugin>> classpathPlugins) |
|
Node(Settings preparedSettings)
Constructs a node with the given settings.
|
Modifier and Type | Method and Description |
---|---|
static Settings |
addNodeNameIfNeeded(Settings settings,
java.lang.String nodeId)
Adds a default node name to the given setting, if it doesn't already exist
|
Client |
client()
A client that can be used to execute actions (operations) against the cluster.
|
void |
close() |
static CircuitBreakerService |
createCircuitBreakerService(Settings settings,
ClusterSettings clusterSettings)
Creates a new
CircuitBreakerService based on the settings provided. |
Environment |
getEnvironment()
Returns the environment of the node
|
NodeEnvironment |
getNodeEnvironment()
Returns the
NodeEnvironment instance of this node |
protected PluginsService |
getPluginsService()
The
PluginsService used to build this node's components. |
Injector |
injector() |
boolean |
isClosed()
Returns true if the node is closed.
|
protected ClusterInfoService |
newClusterInfoService(Settings settings,
ClusterService clusterService,
ThreadPool threadPool,
NodeClient client)
Constructs a ClusterInfoService which may be mocked for tests.
|
protected SearchService |
newSearchService(ClusterService clusterService,
IndicesService indicesService,
ThreadPool threadPool,
ScriptService scriptService,
BigArrays bigArrays,
FetchPhase fetchPhase)
Creates a new the SearchService.
|
protected TransportService |
newTransportService(Settings settings,
Transport transport,
ThreadPool threadPool,
TransportInterceptor interceptor,
java.util.function.Function<BoundTransportAddress,DiscoveryNode> localNodeFactory,
ClusterSettings clusterSettings) |
protected Node |
newTribeClientNode(Settings settings,
java.util.Collection<java.lang.Class<? extends Plugin>> classpathPlugins)
Constructs an internal node used as a client into a cluster fronted by this tribe node.
|
protected void |
processRecoverySettings(ClusterSettings clusterSettings,
RecoverySettings recoverySettings) |
Settings |
settings()
The settings that were used to create the node.
|
Node |
start()
Start the node.
|
protected void |
validateNodeBeforeAcceptingRequests(Settings settings,
BoundTransportAddress boundTransportAddress,
java.util.List<BootstrapCheck> bootstrapChecks)
Hook for validating the node after network
services are started but before the cluster service is started
and before the network service starts accepting incoming network
requests.
|
public static final Setting<java.lang.Boolean> WRITE_PORTS_FILE_SETTING
public static final Setting<java.lang.Boolean> NODE_DATA_SETTING
public static final Setting<java.lang.Boolean> NODE_MASTER_SETTING
public static final Setting<java.lang.Boolean> NODE_INGEST_SETTING
public static final Setting<java.lang.Boolean> NODE_LOCAL_STORAGE_SETTING
NODE_DATA_SETTING
). However, if this is false, NODE_DATA_SETTING
and NODE_MASTER_SETTING
must also be false.public static final Setting<java.lang.String> NODE_NAME_SETTING
public static final Setting<java.lang.String> BREAKER_TYPE_KEY
public Node(Settings preparedSettings)
preparedSettings
- Base settings to configure the node withpublic Node(Environment environment)
protected Node(Environment environment, java.util.Collection<java.lang.Class<? extends Plugin>> classpathPlugins)
public static final Settings addNodeNameIfNeeded(Settings settings, java.lang.String nodeId)
protected TransportService newTransportService(Settings settings, Transport transport, ThreadPool threadPool, TransportInterceptor interceptor, java.util.function.Function<BoundTransportAddress,DiscoveryNode> localNodeFactory, ClusterSettings clusterSettings)
protected void processRecoverySettings(ClusterSettings clusterSettings, RecoverySettings recoverySettings)
public Settings settings()
public Client client()
public Environment getEnvironment()
public NodeEnvironment getNodeEnvironment()
NodeEnvironment
instance of this nodepublic Node start() throws NodeValidationException
NodeValidationException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public boolean isClosed()
public Injector injector()
protected void validateNodeBeforeAcceptingRequests(Settings settings, BoundTransportAddress boundTransportAddress, java.util.List<BootstrapCheck> bootstrapChecks) throws NodeValidationException
settings
- the fully-resolved settingsboundTransportAddress
- the network addresses the node is
bound and publishing toNodeValidationException
protected PluginsService getPluginsService()
PluginsService
used to build this node's components.public static CircuitBreakerService createCircuitBreakerService(Settings settings, ClusterSettings clusterSettings)
CircuitBreakerService
based on the settings provided.BREAKER_TYPE_KEY
protected SearchService newSearchService(ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ScriptService scriptService, BigArrays bigArrays, FetchPhase fetchPhase)
protected Node newTribeClientNode(Settings settings, java.util.Collection<java.lang.Class<? extends Plugin>> classpathPlugins)
protected ClusterInfoService newClusterInfoService(Settings settings, ClusterService clusterService, ThreadPool threadPool, NodeClient client)