From 2fd36fdbf8d46ad53d8223f4450b2eaea2b50d2a Mon Sep 17 00:00:00 2001 From: kimchy Date: Fri, 9 Apr 2010 03:17:29 +0300 Subject: [PATCH] add local node to node builder --- .../java/org/elasticsearch/node/NodeBuilder.java | 12 ++++++++++++ .../test/SimpleAttachmentIntegrationTests.java | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/node/NodeBuilder.java b/modules/elasticsearch/src/main/java/org/elasticsearch/node/NodeBuilder.java index b9632935ed9..48b2f7c7bbc 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/node/NodeBuilder.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/node/NodeBuilder.java @@ -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 cluster.name setting). Defaults * to elasticsearch. diff --git a/plugins/attachments/src/test/java/org/elasticsearch/plugin/attachments/test/SimpleAttachmentIntegrationTests.java b/plugins/attachments/src/test/java/org/elasticsearch/plugin/attachments/test/SimpleAttachmentIntegrationTests.java index 065563d1866..a5a46598c6a 100644 --- a/plugins/attachments/src/test/java/org/elasticsearch/plugin/attachments/test/SimpleAttachmentIntegrationTests.java +++ b/plugins/attachments/src/test/java/org/elasticsearch/plugin/attachments/test/SimpleAttachmentIntegrationTests.java @@ -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() {