@Singleton public class Cluster extends Object
| Constructor and Description |
|---|
Cluster(org.elasticsearch.client.Client client,
Deflector deflector,
ScheduledExecutorService scheduler,
com.github.joschi.jadconfig.util.Duration requestTimeout) |
| Modifier and Type | Method and Description |
|---|---|
Map<String,org.elasticsearch.action.admin.cluster.node.info.NodeInfo> |
getAllNodes() |
Map<String,org.elasticsearch.action.admin.cluster.node.info.NodeInfo> |
getDataNodes() |
Map<String,org.elasticsearch.action.admin.cluster.node.stats.NodeStats> |
getNodesStats(String... nodesIds) |
org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse |
health() |
boolean |
isConnected()
Check if the Elasticsearch
Node is connected and that there are other nodes
in the cluster. |
boolean |
isHealthy()
Check if the cluster health status is not
ClusterHealthStatus.RED and that the
deflector is up. |
String |
nodeIdToHostName(String nodeId) |
String |
nodeIdToName(String nodeId) |
void |
updateDataNodeList(Map<String,org.elasticsearch.cluster.node.DiscoveryNode> nodes) |
void |
waitForConnectedAndHealthy() |
void |
waitForConnectedAndHealthy(long timeout,
TimeUnit unit) |
@Inject
public Cluster(org.elasticsearch.client.Client client,
Deflector deflector,
@Named(value="daemonScheduler")
ScheduledExecutorService scheduler,
@Named(value="elasticsearch_request_timeout")
com.github.joschi.jadconfig.util.Duration requestTimeout)
public org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse health()
public Map<String,org.elasticsearch.action.admin.cluster.node.info.NodeInfo> getDataNodes()
public Map<String,org.elasticsearch.action.admin.cluster.node.info.NodeInfo> getAllNodes()
public Map<String,org.elasticsearch.action.admin.cluster.node.stats.NodeStats> getNodesStats(String... nodesIds)
public boolean isConnected()
Node is connected and that there are other nodes
in the cluster.true if the Elasticsearch client is up and the cluster contains other nodes, false otherwisepublic boolean isHealthy()
ClusterHealthStatus.RED and that the
deflector is up.true if the the cluster is healthy and the deflector is up, false otherwisepublic void waitForConnectedAndHealthy(long timeout,
TimeUnit unit)
throws InterruptedException,
TimeoutException
InterruptedExceptionTimeoutExceptionpublic void waitForConnectedAndHealthy()
throws InterruptedException,
TimeoutException
InterruptedExceptionTimeoutExceptionCopyright © 2012-2016 Graylog, Inc.. All Rights Reserved.