當前位置: 首頁>>代碼示例>>Java>>正文


Java Node.stop方法代碼示例

本文整理匯總了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();
}
 
開發者ID:graben1437,項目名稱:titan1withtp3.1,代碼行數:35,代碼來源:ElasticSearchConfigTest.java

示例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();
}
 
開發者ID:graben1437,項目名稱:titan0.5.4-hbase1.1.1-custom,代碼行數:32,代碼來源:ElasticSearchConfigTest.java

示例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();
}
 
開發者ID:Ryan-ZA,項目名稱:async-elastic-orm,代碼行數:12,代碼來源:GDSImpl.java

示例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();
}
 
開發者ID:szwork2013,項目名稱:elasticsearch-sentiment,代碼行數:12,代碼來源:AbstractNodeTestHelper.java


注:本文中的org.elasticsearch.node.Node.stop方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。