@Singleton public class Cluster extends Object
| Constructor and Description |
|---|
Cluster(org.elasticsearch.node.Node node,
Deflector deflector,
ScheduledExecutorService scheduler) |
| Modifier and Type | Method and Description |
|---|---|
List<org.elasticsearch.action.admin.cluster.node.info.NodeInfo> |
getAllNodes() |
List<org.elasticsearch.action.admin.cluster.node.info.NodeInfo> |
getDataNodes() |
int |
getNumberOfNodes() |
org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse |
health() |
boolean |
isConnectedAndHealthy()
Check if the Elasticsearch
Node is connected and that 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() |
@Inject
public Cluster(org.elasticsearch.node.Node node,
Deflector deflector,
@Named(value="daemonScheduler")
ScheduledExecutorService scheduler)
public org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse health()
public int getNumberOfNodes()
public List<org.elasticsearch.action.admin.cluster.node.info.NodeInfo> getDataNodes()
public List<org.elasticsearch.action.admin.cluster.node.info.NodeInfo> getAllNodes()
public boolean isConnectedAndHealthy()
Node is connected and that the cluster health status
is not ClusterHealthStatus.RED and that the deflector is up.true if the Elasticsearch client is up and the cluster is healthy and the deflector is up, false otherwisepublic void waitForConnectedAndHealthy()
throws InterruptedException
InterruptedExceptionCopyright © 2012-2015 Graylog, Inc.. All Rights Reserved.