Package org.graylog2.indexer.cluster
Class Cluster
java.lang.Object
org.graylog2.indexer.cluster.Cluster
-
Constructor Summary
ConstructorDescriptionCluster
(IndexSetRegistry indexSetRegistry, ScheduledExecutorService scheduler, com.github.joschi.jadconfig.util.Duration requestTimeout, ClusterAdapter clusterAdapter) -
Method Summary
Modifier and TypeMethodDescriptionRequests the cluster health for the current write index.health()
Requests the cluster health for all indices managed by Graylog.boolean
Check if Elasticsearch is available and that there are data nodes in the cluster.boolean
Check if the deflector (write index) health status is not RED and that thedeflector is up
.boolean
Check if the cluster health status is not RED and that thedeflector is up
.nodeIdToHostName
(String nodeId) nodeIdToName
(String nodeId) void
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.
-
Constructor Details
-
Cluster
@Inject public Cluster(IndexSetRegistry indexSetRegistry, @Named("daemonScheduler") ScheduledExecutorService scheduler, @Named("elasticsearch_socket_timeout") com.github.joschi.jadconfig.util.Duration requestTimeout, ClusterAdapter clusterAdapter)
-
-
Method Details
-
health
Requests the cluster health for all indices managed by Graylog. (default: graylog_*)- Returns:
- the cluster health response
-
deflectorHealth
Requests the cluster health for the current write index. (deflector) This can be used to decide if the current write index is healthy and writable even when older indices have problems.- Returns:
- the cluster health response
-
getFileDescriptorStats
-
getDiskUsageStats
-
getClusterAllocationDiskSettings
-
nodeIdToName
-
nodeIdToHostName
-
isConnected
public boolean isConnected()Check if Elasticsearch is available and that there are data nodes in the cluster.- Returns:
true
if the Elasticsearch client is up and the cluster contains data nodes,false
otherwise
-
isHealthy
public boolean isHealthy()Check if the cluster health status is not RED and that thedeflector is up
.- Returns:
true
if the cluster is healthy and the deflector is up,false
otherwise
-
isDeflectorHealthy
public boolean isDeflectorHealthy()Check if the deflector (write index) health status is not RED and that thedeflector is up
.- Returns:
true
if the deflector is healthy and up,false
otherwise
-
waitForConnectedAndDeflectorHealthy
public void waitForConnectedAndDeflectorHealthy(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException Blocks until the Elasticsearch cluster and current write index is healthy again or the given timeout fires.- Parameters:
timeout
- the timeout valueunit
- the timeout unit- Throws:
InterruptedException
TimeoutException
-
waitForConnectedAndDeflectorHealthy
Blocks until the Elasticsearch cluster and current write index is healthy again or the default timeout fires.- Throws:
InterruptedException
TimeoutException
-
clusterName
-
clusterHealthStats
-
elasticsearchStats
-