org.elasticsearch.action.admin.cluster.node.stats.NodesStatsRequestBuilder.all()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(1.3k)|赞(0)|评价(0)|浏览(149)

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

NodesStatsRequestBuilder.all介绍

[英]Sets all the request flags.
[中]设置所有请求标志。

代码示例

代码示例来源:origin: pinterest/soundwave

public Map<String, NodeStats> getNodesStats() throws Exception {
 NodesStatsResponse nodesStats = esClient.admin().cluster().prepareNodesStats().all().get();
 return nodesStats.getNodesMap();
}

代码示例来源:origin: com.netflix.raigad/raigad

/**
 * Hostname and Port to talk to will be same server for now optionally we
 * might want the ip to poll.
 * 
 * NOTE: This class shouldn't be a singleton and this shouldn't be cached.
 * 
 * This will work only if Elasticsearch runs.
 */
public ESTransportClient(String host, int port, String clusterName) throws IOException, InterruptedException
{
  Settings settings = ImmutableSettings.settingsBuilder().put("cluster.name", clusterName)
      .put("client.transport.sniff", true)
      .build();
  client = new TransportClient(settings);
  client.addTransportAddress(new InetSocketTransportAddress(host,port));
  ndStatsRequestBuilder = client.admin().cluster().prepareNodesStats("_local").all();
}

相关文章