当前位置: 首页>>代码示例>>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;未经允许,请勿转载。