org.elasticsearch.node.Node.stop()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(196)

本文整理了Java中org.elasticsearch.node.Node.stop()方法的一些代码示例,展示了Node.stop()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.stop()方法的具体详情如下:
包路径:org.elasticsearch.node.Node
类名称:Node
方法名:stop

Node.stop介绍

暂无

代码示例

代码示例来源:origin: thinkaurelius/titan

  1. @Test
  2. public void testIndexCreationOptions() throws InterruptedException, BackendException {
  3. final int shards = 77;
  4. ElasticsearchRunner esr = new ElasticsearchRunner(".", "indexCreationOptions.yml");
  5. esr.start();
  6. CommonsConfiguration cc = new CommonsConfiguration(new BaseConfiguration());
  7. cc.set("index." + INDEX_NAME + ".elasticsearch.create.ext.number_of_shards", String.valueOf(shards));
  8. cc.set("index." + INDEX_NAME + ".elasticsearch.ext.cluster.name", "indexCreationOptions");
  9. ModifiableConfiguration config =
  10. new ModifiableConfiguration(GraphDatabaseConfiguration.ROOT_NS,
  11. cc, BasicConfiguration.Restriction.NONE);
  12. config.set(INTERFACE, ElasticSearchSetup.NODE.toString(), INDEX_NAME);
  13. Configuration indexConfig = config.restrictTo(INDEX_NAME);
  14. IndexProvider idx = new ElasticSearchIndex(indexConfig);
  15. simpleWriteAndQuery(idx);
  16. ImmutableSettings.Builder settingsBuilder = ImmutableSettings.settingsBuilder();
  17. settingsBuilder.put("discovery.zen.ping.multicast.enabled", "false");
  18. settingsBuilder.put("discovery.zen.ping.unicast.hosts", "localhost,127.0.0.1:9300");
  19. settingsBuilder.put("cluster.name", "indexCreationOptions");
  20. NodeBuilder nodeBuilder = NodeBuilder.nodeBuilder().settings(settingsBuilder.build());
  21. nodeBuilder.client(true).data(false).local(false);
  22. Node n = nodeBuilder.build().start();
  23. GetSettingsResponse response = n.client().admin().indices().getSettings(new GetSettingsRequest().indices("titan")).actionGet();
  24. assertEquals(String.valueOf(shards), response.getSetting("titan", "index.number_of_shards"));
  25. idx.close();
  26. n.stop();
  27. esr.stop();
  28. }

代码示例来源:origin: org.elasticsearch/elasticsearch

  1. @Override
  2. public synchronized void close() throws IOException {
  3. if (lifecycle.started()) {
  4. stop();

代码示例来源:origin: io.fabric8.insight/insight-elasticsearch-factory

  1. @Override
  2. public Node stop() {
  3. return nodeDelegate.stop();
  4. }

代码示例来源:origin: jboss-fuse/fabric8

  1. @Override
  2. public Node stop() {
  3. return nodeDelegate.stop();
  4. }

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

  1. /**
  2. * hook for JSVC
  3. */
  4. @Override
  5. public void stop() {
  6. super.stop();
  7. if (node != null)
  8. node.stop();
  9. }

代码示例来源:origin: org.vertexium/vertexium-elasticsearch-singledocument

  1. @Override
  2. public void shutdown() {
  3. client.close();
  4. if (inProcessNode != null) {
  5. inProcessNode.stop();
  6. inProcessNode = null;
  7. }
  8. if (propertyNameVisibilitiesStore instanceof Closeable) {
  9. try {
  10. ((Closeable) propertyNameVisibilitiesStore).close();
  11. } catch (IOException e) {
  12. Throwables.propagate(e);
  13. }
  14. }
  15. }

代码示例来源:origin: stackoverflow.com

  1. BasicConfigurator.configure();
  2. Node node = NodeBuilder.nodeBuilder().local(true).node();
  3. node.start();
  4. while (!node.isClosed()) {
  5. try {
  6. Thread.sleep(60*1000);
  7. } catch (InterruptedException e) {
  8. node.close();
  9. }
  10. }
  11. node.stop();

代码示例来源:origin: com.strapdata.elasticsearch.test/framework

  1. private static void stopNode() throws IOException {
  2. if (ElassandraDaemon.instance != null) {
  3. Node node = ElassandraDaemon.instance.node();
  4. if (node != null)
  5. node.stop();
  6. ElassandraDaemon.instance.node(null);
  7. IOUtils.close(node);
  8. }
  9. }

代码示例来源:origin: stackoverflow.com

  1. elasticSearchNode.stop();
  2. elasticSearchNode.close();

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

  1. @Override
  2. public synchronized void close() throws IOException {
  3. if (lifecycle.started()) {
  4. stop();

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

  1. @Override
  2. public synchronized void close() throws IOException {
  3. if (lifecycle.started()) {
  4. stop();

代码示例来源:origin: apache/servicemix-bundles

  1. toClose.add(() -> stopWatch.stop().start("plugin(" + plugin.getClass().getName() + ")"));
  2. toClose.add(plugin);
  3. toClose.add(() -> stopWatch.stop().start("script"));
  4. toClose.add(injector.getInstance(ScriptService.class));
  5. toClose.add(() -> stopWatch.stop().start("thread_pool"));

代码示例来源:origin: harbby/presto-connectors

  1. @Override
  2. public synchronized void close() {
  3. if (lifecycle.started()) {
  4. stop();

相关文章