org.elasticsearch.client.RestHighLevelClient.close()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(219)

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

RestHighLevelClient.close介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-data-elasticsearch

@Override
public void destroy() throws Exception {
  try {
    log.info("Closing elasticSearch  client");
    if (client != null) {
      client.close();
    }
  } catch (final Exception e) {
    log.error("Error closing ElasticSearch client: ", e);
  }
}

代码示例来源:origin: spring-projects/spring-data-elasticsearch

@Override
  default void close() throws IOException {
    rest().close();
  }
}

代码示例来源:origin: dadoonet/fscrawler

@Override
public void close() throws IOException {
  logger.debug("Closing Elasticsearch client manager");
  if (bulkProcessor != null) {
    try {
      bulkProcessor.awaitClose(30, TimeUnit.SECONDS);
    } catch (InterruptedException e) {
      logger.warn("Did not succeed in closing the bulk processor for documents", e);
      throw new IOException(e);
    }
  }
  if (client != null) {
    client.close();
  }
}

代码示例来源:origin: dadoonet/fscrawler

@Override
public void close() throws IOException {
  logger.debug("Closing Elasticsearch client manager");
  if (bulkProcessor != null) {
    try {
      bulkProcessor.awaitClose(30, TimeUnit.SECONDS);
    } catch (InterruptedException e) {
      logger.warn("Did not succeed in closing the bulk processor for documents", e);
      throw new IOException(e);
    }
  }
  if (client != null) {
    client.close();
  }
}

代码示例来源:origin: DigitalPebble/storm-crawler

@Override
public void cleanup() {
  if (client != null)
    try {
      client.close();
    } catch (IOException e) {
    }
}

代码示例来源:origin: DigitalPebble/storm-crawler

@Override
public void close() {
  if (client != null)
    try {
      client.close();
    } catch (IOException e) {
    }
}

代码示例来源:origin: DomoXian/elastic-demo

@Override
public void destroy() throws Exception {
  restHighLevelClient.close();
}

代码示例来源:origin: SeaseLtd/rated-ranking-evaluator

/**
   * Close the Elasticsearch connector.
   *
   * @throws IOException if problems occur closing the connection.
   */
  public void close() throws IOException {
    client.close();
  }
}

代码示例来源:origin: hellobike/tunnel

public void close() {
  try {
    this.restClient.close();
  } catch (Exception e) {
    //
  }
}

代码示例来源:origin: zeebe-io/zeebe

public void close() throws IOException {
 client.close();
}

代码示例来源:origin: io.reactiverse/elasticsearch-client

@Override()
public void close() {
  try {
    delegate.close();
  } catch (Throwable t) {
    throw new RuntimeException(t);
  }
}

代码示例来源:origin: dadoonet/spring-elasticsearch

@Override
public void destroy() {
  try {
    logger.info("Closing Elasticsearch client");
    if (client != null) {
      client.close();
    }
  } catch (final Exception e) {
    logger.error("Error closing Elasticsearch client: ", e);
  }
}

代码示例来源:origin: SeaseLtd/rated-ranking-evaluator

private void closeClient(RestHighLevelClient client) {
  try {
    client.close();
  } catch (IOException e) {
    LOGGER.error("Caught IOException closing ES HTTP Client :: " + e.getMessage());
  }
}

代码示例来源:origin: com.jslsolucoes/elasticsearch-ee

public void disposes(@Disposes RestHighLevelClient restHighLevelClient) {
try {
  restHighLevelClient.close();
} catch (IOException e) {
  e.printStackTrace();
}
}

代码示例来源:origin: DigitalPebble/storm-crawler

public void close() {
    // First, close the BulkProcessor ensuring pending actions are flushed
    if (processor != null) {
      try {
        boolean success = processor.awaitClose(60, TimeUnit.SECONDS);
        if (!success) {
          throw new RuntimeException(
              "Failed to flush pending actions when closing BulkProcessor");
        }
      } catch (InterruptedException e) {
        throw new RuntimeException(e);
      }
    }

    // Now close the actual client
    if (client != null) {
      try {
        client.close();
      } catch (IOException e) {
        // ignore silently
      }
    }
  }
}

代码示例来源:origin: streampipes/streampipes-ce

request.addScrollId(scrollId);
client.close();

相关文章