Package org.graylog2.indexer.cluster
Class Cluster
java.lang.Object
org.graylog2.indexer.cluster.Cluster
-
Constructor Summary
ConstructorsConstructorDescriptionCluster(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.booleanCheck if Elasticsearch is available and that there are data nodes in the cluster.booleanCheck if the deflector (write index) health status is not RED and that thedeflector is up.booleanCheck if the cluster health status is not RED and that thedeflector is up.nodeIdToHostName(String nodeId) nodeIdToName(String nodeId) voidBlocks until the Elasticsearch cluster and current write index is healthy again or the default timeout fires.voidwaitForConnectedAndDeflectorHealthy(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:
trueif the Elasticsearch client is up and the cluster contains data nodes,falseotherwise
-
isHealthy
public boolean isHealthy()Check if the cluster health status is not RED and that thedeflector is up.- Returns:
trueif the cluster is healthy and the deflector is up,falseotherwise
-
isDeflectorHealthy
public boolean isDeflectorHealthy()Check if the deflector (write index) health status is not RED and that thedeflector is up.- Returns:
trueif the deflector is healthy and up,falseotherwise
-
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:
InterruptedExceptionTimeoutException
-
waitForConnectedAndDeflectorHealthy
Blocks until the Elasticsearch cluster and current write index is healthy again or the default timeout fires.- Throws:
InterruptedExceptionTimeoutException
-
clusterName
-
clusterHealthStats
-
elasticsearchStats
-