public abstract class AbstractCluster extends Object implements Cluster
| 构造器和说明 |
|---|
AbstractCluster(org.apache.http.HttpHost[] hosts) |
AbstractCluster(org.apache.http.HttpHost[] hosts,
Credentials credentials) |
AbstractCluster(String hostname,
int port) |
AbstractCluster(String hostname,
int port,
Credentials credentials) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
catAsync(CatRequest catRequest,
org.elasticsearch.action.ActionListener<CatResponse> listener)
异步cat接口
|
void |
close() |
protected org.elasticsearch.client.RestClientBuilder |
createBuilder(org.apache.http.HttpHost[] hosts)
创建客户端构建器
|
protected void |
customHttpClientConfig(org.apache.http.impl.nio.client.HttpAsyncClientBuilder builder)
定制HttpClientConfig
|
org.elasticsearch.client.RestClientBuilder |
getBuilder()
获取ES集群构建器
|
protected org.apache.http.HttpHost[] |
getHosts() |
String |
getName()
获取集群的名称,此名字可以用于日志打印,来确定当次ES操作在那个上面
|
org.elasticsearch.client.RestHighLevelClient |
highLevelClient()
从集群种创建或者获取高级客户端
|
org.elasticsearch.client.RestClient |
lowLevelClient()
获取底层客户端
|
protected void |
setName(String name)
子类可以手动设置集群的名称,可以更有意义些的名字
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbulkAsync, clearScrollAsync, deleteAsync, deleteByQueryAsync, getAsync, indexAsync, localhost, localhost, mgetAsync, multiSearchAsync, scrollAsync, searchAsync, simple, simple, simple, simple, simple, simple, updateAsync, updateByQueryAsync, weighted, weighted, weighted, weighted, weighted, weightedpublic AbstractCluster(String hostname, int port)
public AbstractCluster(String hostname, int port, Credentials credentials)
public AbstractCluster(org.apache.http.HttpHost[] hosts)
public AbstractCluster(org.apache.http.HttpHost[] hosts,
Credentials credentials)
protected org.apache.http.HttpHost[] getHosts()
protected void setName(String name)
name - 集群名称public org.elasticsearch.client.RestClientBuilder getBuilder()
protected org.elasticsearch.client.RestClientBuilder createBuilder(org.apache.http.HttpHost[] hosts)
hosts - ES主机列表protected void customHttpClientConfig(org.apache.http.impl.nio.client.HttpAsyncClientBuilder builder)
builder - 客户端构建器public org.elasticsearch.client.RestHighLevelClient highLevelClient()
ClusterhighLevelClient 在接口中 Clusterpublic org.elasticsearch.client.RestClient lowLevelClient()
ClusterlowLevelClient 在接口中 Clusterpublic void catAsync(CatRequest catRequest, org.elasticsearch.action.ActionListener<CatResponse> listener)
Clusterpublic void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableIOExceptionCopyright © 2021. All rights reserved.