@Singleton public class Cluster extends Object
| Constructor and Description |
|---|
Cluster(IndexSetRegistry indexSetRegistry,
ScheduledExecutorService scheduler,
com.github.joschi.jadconfig.util.Duration requestTimeout,
ClusterAdapter clusterAdapter) |
| Modifier and Type | Method and Description |
|---|---|
Optional<ClusterHealth> |
clusterHealthStats() |
Optional<String> |
clusterName() |
Optional<HealthStatus> |
deflectorHealth()
Requests the cluster health for the current write index.
|
ElasticsearchStats |
elasticsearchStats() |
ClusterAllocationDiskSettings |
getClusterAllocationDiskSettings() |
Set<NodeDiskUsageStats> |
getDiskUsageStats() |
Set<NodeFileDescriptorStats> |
getFileDescriptorStats() |
Optional<HealthStatus> |
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(IndexSetRegistry indexSetRegistry, @Named(value="daemonScheduler") ScheduledExecutorService scheduler, @Named(value="elasticsearch_socket_timeout") com.github.joschi.jadconfig.util.Duration requestTimeout, ClusterAdapter clusterAdapter)
public Optional<HealthStatus> health()
public Optional<HealthStatus> deflectorHealth()
public Set<NodeFileDescriptorStats> getFileDescriptorStats()
public Set<NodeDiskUsageStats> getDiskUsageStats()
public ClusterAllocationDiskSettings getClusterAllocationDiskSettings()
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
InterruptedExceptionTimeoutExceptionpublic Optional<ClusterHealth> clusterHealthStats()
public ElasticsearchStats elasticsearchStats()
Copyright © 2012–2021 Graylog, Inc.. All rights reserved.