@Singleton public class Cluster extends Object
| Constructor and Description |
|---|
Cluster(io.searchbox.client.JestClient jestClient,
IndexSetRegistry indexSetRegistry,
ScheduledExecutorService scheduler,
com.github.joschi.jadconfig.util.Duration requestTimeout) |
| Modifier and Type | Method and Description |
|---|---|
Optional<com.fasterxml.jackson.databind.JsonNode> |
deflectorHealth()
Requests the cluster health for the current write index.
|
Set<NodeFileDescriptorStats> |
getFileDescriptorStats() |
Optional<com.fasterxml.jackson.databind.JsonNode> |
health()
Requests the cluster health for all indices managed by Graylog.
|
boolean |
isConnected()
Check if Elasticsearch is available and that there are data nodes in the cluster.
|
boolean |
isDeflectorHealthy()
Check if the deflector (write index) health status is not RED and that the
deflector is up. |
boolean |
isHealthy()
Check if the cluster health status is not RED and that the
deflector is up. |
Optional<String> |
nodeIdToHostName(String nodeId) |
Optional<String> |
nodeIdToName(String nodeId) |
void |
waitForConnectedAndDeflectorHealthy()
Blocks until the Elasticsearch cluster and current write index is healthy again or the default timeout fires.
|
void |
waitForConnectedAndDeflectorHealthy(long timeout,
TimeUnit unit)
Blocks until the Elasticsearch cluster and current write index is healthy again or the given timeout fires.
|
@Inject
public Cluster(io.searchbox.client.JestClient jestClient,
IndexSetRegistry indexSetRegistry,
@Named(value="daemonScheduler")
ScheduledExecutorService scheduler,
@Named(value="elasticsearch_request_timeout")
com.github.joschi.jadconfig.util.Duration requestTimeout)
public Optional<com.fasterxml.jackson.databind.JsonNode> health()
public Optional<com.fasterxml.jackson.databind.JsonNode> deflectorHealth()
public Set<NodeFileDescriptorStats> getFileDescriptorStats()
public boolean isConnected()
true if the Elasticsearch client is up and the cluster contains data nodes, false otherwisepublic boolean isHealthy()
deflector is up.true if the the cluster is healthy and the deflector is up, false otherwisepublic boolean isDeflectorHealthy()
deflector is up.true if the deflector is healthy and up, false otherwisepublic void waitForConnectedAndDeflectorHealthy(long timeout,
TimeUnit unit)
throws InterruptedException,
TimeoutException
timeout - the timeout valueunit - the timeout unitInterruptedExceptionTimeoutExceptionpublic void waitForConnectedAndDeflectorHealthy()
throws InterruptedException,
TimeoutException
InterruptedExceptionTimeoutExceptionCopyright © 2012–2020 Graylog, Inc.. All rights reserved.