use of org.elasticsearch.client.ClusterAdminClient in project graylog2-server by Graylog2.
the class Cluster method getNodesStats.
public Map<String, NodeStats> getNodesStats(String... nodesIds) {
final ClusterAdminClient clusterAdminClient = c.admin().cluster();
final NodesStatsRequest request = clusterAdminClient.prepareNodesStats(nodesIds).request();
final ImmutableMap.Builder<String, NodeStats> builder = ImmutableMap.builder();
for (NodeStats nodeStats : clusterAdminClient.nodesStats(request).actionGet().getNodes()) {
builder.put(nodeStats.getNode().id(), nodeStats);
}
return builder.build();
}
use of org.elasticsearch.client.ClusterAdminClient in project graylog2-server by Graylog2.
the class Cluster method getAllNodes.
public Map<String, NodeInfo> getAllNodes() {
final ClusterAdminClient clusterAdminClient = c.admin().cluster();
final NodesInfoRequest request = clusterAdminClient.prepareNodesInfo().all().request();
final ImmutableMap.Builder<String, NodeInfo> builder = ImmutableMap.builder();
for (NodeInfo nodeInfo : clusterAdminClient.nodesInfo(request).actionGet().getNodes()) {
builder.put(nodeInfo.getNode().id(), nodeInfo);
}
return builder.build();
}
Aggregations