本文整理匯總了Java中org.elasticsearch.node.Node.stop方法的典型用法代碼示例。如果您正苦於以下問題:Java Node.stop方法的具體用法?Java Node.stop怎麽用?Java Node.stop使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.elasticsearch.node.Node
的用法示例。
在下文中一共展示了Node.stop方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testIndexCreationOptions
import org.elasticsearch.node.Node; //導入方法依賴的package包/類
@Test
public void testIndexCreationOptions() throws InterruptedException, BackendException {
final int shards = 77;
ElasticsearchRunner esr = new ElasticsearchRunner(".", "indexCreationOptions.yml");
esr.start();
CommonsConfiguration cc = new CommonsConfiguration(new BaseConfiguration());
cc.set("index." + INDEX_NAME + ".elasticsearch.create.ext.number_of_shards", String.valueOf(shards));
cc.set("index." + INDEX_NAME + ".elasticsearch.ext.cluster.name", "indexCreationOptions");
ModifiableConfiguration config =
new ModifiableConfiguration(GraphDatabaseConfiguration.ROOT_NS,
cc, BasicConfiguration.Restriction.NONE);
config.set(INTERFACE, ElasticSearchSetup.NODE.toString(), INDEX_NAME);
Configuration indexConfig = config.restrictTo(INDEX_NAME);
IndexProvider idx = new ElasticSearchIndex(indexConfig);
simpleWriteAndQuery(idx);
ImmutableSettings.Builder settingsBuilder = ImmutableSettings.settingsBuilder();
settingsBuilder.put("discovery.zen.ping.multicast.enabled", "false");
settingsBuilder.put("discovery.zen.ping.unicast.hosts", "localhost,127.0.0.1:9300");
settingsBuilder.put("cluster.name", "indexCreationOptions");
NodeBuilder nodeBuilder = NodeBuilder.nodeBuilder().settings(settingsBuilder.build());
nodeBuilder.client(true).data(false).local(false);
Node n = nodeBuilder.build().start();
GetSettingsResponse response = n.client().admin().indices().getSettings(new GetSettingsRequest().indices("titan")).actionGet();
assertEquals(String.valueOf(shards), response.getSetting("titan", "index.number_of_shards"));
idx.close();
n.stop();
esr.stop();
}
示例2: testIndexCreationOptions
import org.elasticsearch.node.Node; //導入方法依賴的package包/類
@Test
public void testIndexCreationOptions() throws InterruptedException, BackendException {
final int shards = 77;
ElasticsearchRunner esr = new ElasticsearchRunner();
esr.start();
CommonsConfiguration cc = new CommonsConfiguration(new BaseConfiguration());
cc.set("index." + INDEX_NAME + ".elasticsearch.create.ext.number_of_shards", String.valueOf(shards));
ModifiableConfiguration config =
new ModifiableConfiguration(GraphDatabaseConfiguration.ROOT_NS,
cc, BasicConfiguration.Restriction.NONE);
config.set(INTERFACE, ElasticSearchSetup.NODE, INDEX_NAME);
Configuration indexConfig = config.restrictTo(INDEX_NAME);
IndexProvider idx = new ElasticSearchIndex(indexConfig);
simpleWriteAndQuery(idx);
idx.close();
ImmutableSettings.Builder settingsBuilder = ImmutableSettings.settingsBuilder();
settingsBuilder.put("discovery.zen.ping.multicast.enabled", "false");
settingsBuilder.put("discovery.zen.ping.unicast.hosts", "localhost,127.0.0.1:9300");
NodeBuilder nodeBuilder = NodeBuilder.nodeBuilder().settings(settingsBuilder.build());
nodeBuilder.client(true).data(false).local(false);
Node n = nodeBuilder.build().start();
GetSettingsRequest request = new GetSettingsRequestBuilder((NodeClient)n.client(), "titan").request();
GetSettingsResponse response = n.client().admin().indices().getSettings(request).actionGet();
assertEquals(String.valueOf(shards), response.getSetting("titan", "index.number_of_shards"));
n.stop();
esr.stop();
}
示例3: shutdownAllNodes
import org.elasticsearch.node.Node; //導入方法依賴的package包/類
public static synchronized void shutdownAllNodes() {
for (Client client : ESClientHolder.clientMap.values()) {
client.close();
}
for (Node node : ESClientHolder.nodeList) {
node.stop();
node.close();
}
ESClientHolder.nodeList.clear();
ESClientHolder.clientMap.clear();
}
示例4: stopNodes
import org.elasticsearch.node.Node; //導入方法依賴的package包/類
public void stopNodes() {
for (Client client : clients.values()) {
client.close();
}
clients.clear();
for (Node node : nodes.values()) {
node.stop();
node.close();
}
nodes.clear();
}