|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.elasticsearch.node.NodeBuilder
public class NodeBuilder
A node builder is used to construct a Node
instance.
Settings will be loaded relative to the ES home (with or without config/ prefix) and if not found,
within the classpath (with or without config/ prefix). The settings file loaded can either be named
elasticsearch.yml or elasticsearch.json). Loading settings can be disabled by calling
loadConfigSettings(boolean)
with false.
Explicit settings can be passed by using the settings(Settings)
method.
In any case, settings will be resolved from system properties as well that are either prefixed with es. or elasticsearch..
An example for creating a simple node with optional settings loaded from the classpath:
Node node = NodeBuilder.nodeBuilder().node();
An example for creating a node with explicit settings (in this case, a node in the cluster that does not hold data):
Node node = NodeBuilder.nodeBuilder() .settings(ImmutableSettings.settingsBuilder().put("node.data", false) .node();
When done with the node, make sure you call Node.close()
on it.
Constructor Summary | |
---|---|
NodeBuilder()
|
Method Summary | |
---|---|
Node |
build()
Builds the node without starting it. |
NodeBuilder |
client(boolean client)
Is the node going to be a client node which means it will hold no data (node.data is set to false) and other optimizations by different modules. |
NodeBuilder |
clusterName(String clusterName)
The cluster name this node is part of (maps to the cluster.name setting). |
NodeBuilder |
data(boolean data)
Is the node going to be allowed to allocate data (shards) to it or not. |
ImmutableSettings.Builder |
getSettings()
Set addition settings simply by working directly against the settings builder. |
NodeBuilder |
loadConfigSettings(boolean loadConfigSettings)
Should the node builder automatically try and load config settings from the file system / classpath. |
NodeBuilder |
local(boolean local)
Is the node a local node. |
Node |
node()
build() s and starts the node. |
static NodeBuilder |
nodeBuilder()
A convenient factory method to create a NodeBuilder . |
ImmutableSettings.Builder |
settings()
Set addition settings simply by working directly against the settings builder. |
NodeBuilder |
settings(Settings.Builder settings)
Explicit node settings to set. |
NodeBuilder |
settings(Settings settings)
Explicit node settings to set. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NodeBuilder()
Method Detail |
---|
public static NodeBuilder nodeBuilder()
NodeBuilder
.
public ImmutableSettings.Builder settings()
public ImmutableSettings.Builder getSettings()
public NodeBuilder settings(Settings.Builder settings)
public NodeBuilder settings(Settings settings)
public NodeBuilder loadConfigSettings(boolean loadConfigSettings)
public NodeBuilder client(boolean client)
client
- Should the node be just a client node or not.public NodeBuilder data(boolean data)
client(boolean)
, the node will
not hold any data by default.
data
- Should the node be allocated data to or not.public NodeBuilder local(boolean local)
local
- Should the node be local or notpublic NodeBuilder clusterName(String clusterName)
clusterName
- The cluster name this node is part of.public Node build()
public Node node()
build()
s and starts the node.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |