org.elasticsearch.client.RestClientBuilder.<init>()方法的使用及代码示例

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

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

RestClientBuilder.<init>介绍

[英]Creates a new builder instance and sets the hosts that the client will send requests to.
[中]创建一个新的生成器实例,并设置客户端将向其发送请求的主机。

代码示例

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

/**
 * Returns a new {@link RestClientBuilder} to help with {@link RestClient} creation.
 */
public static RestClientBuilder builder(HttpHost... hosts) {
  return new RestClientBuilder(hosts);
}

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

/**
 * Returns a new {@link RestClientBuilder} to help with {@link RestClient} creation.
 * Creates a new builder instance and sets the hosts that the client will send requests to.
 */
public static RestClientBuilder builder(HttpHost... hosts) {
  return new RestClientBuilder(hosts);
}

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

/**
 * Returns a new {@link RestClientBuilder} to help with {@link RestClient} creation.
 * Creates a new builder instance and sets the hosts that the client will send requests to.
 * <p>
 * Prefer this to {@link #builder(HttpHost...)} if you have metadata up front about the nodes.
 * If you don't either one is fine.
 */
public static RestClientBuilder builder(Node... nodes) {
  return new RestClientBuilder(nodes == null ? null : Arrays.asList(nodes));
}

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

/**
 * Returns a new {@link RestClientBuilder} to help with {@link RestClient} creation.
 * Creates a new builder instance and sets the nodes that the client will send requests to.
 * <p>
 * You can use this if you do not have metadata up front about the nodes. If you do, prefer
 * {@link #builder(Node...)}.
 * @see Node#Node(HttpHost)
 */
public static RestClientBuilder builder(HttpHost... hosts) {
  return new RestClientBuilder(hostsToNodes(hosts));
}

相关文章