add local node to node builder

This commit is contained in:
kimchy 2010-04-09 03:17:29 +03:00
parent a9cd00e287
commit 2fd36fdbf8
2 changed files with 13 additions and 1 deletions

View File

@ -116,6 +116,18 @@ public class NodeBuilder {
return this;
}
/**
* Is the node a local node. A local node is a node that uses a local (JVM level) discovery and
* transport. Other (local) nodes started within the same JVM (actually, class-loader) will be
* discovered and communicated with. Nodes outside of the JVM will not be discovered.
*
* @param local Should the node be local or not
*/
public NodeBuilder local(boolean local) {
settings.put("node.local", true);
return this;
}
/**
* The cluster name this node is part of (maps to the <tt>cluster.name</tt> setting). Defaults
* to <tt>elasticsearch</tt>.

View File

@ -47,7 +47,7 @@ public class SimpleAttachmentIntegrationTests {
private Node node;
@BeforeClass public void setupServer() {
node = nodeBuilder().settings(settingsBuilder().put("node.local", true)).node();
node = nodeBuilder().local(true).node();
}
@AfterClass public void closeServer() {