Search in sources :

Example 11 with ClusterHealthRequest

use of org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest in project graylog2-server by Graylog2.

the class Indices method waitForStatus.

public ClusterHealthStatus waitForStatus(String index, ClusterHealthStatus clusterHealthStatus) {
    final ClusterHealthRequest request = c.admin().cluster().prepareHealth(index).setWaitForStatus(clusterHealthStatus).request();
    LOG.debug("Waiting until index health status of index {} is {}", index, clusterHealthStatus);
    final ClusterHealthResponse response = c.admin().cluster().health(request).actionGet(5L, TimeUnit.MINUTES);
    return response.getStatus();
}
Also used : ClusterHealthResponse(org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse) ClusterHealthRequest(org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest)

Aggregations

ClusterHealthRequest (org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest)11 ClusterHealthResponse (org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse)8 IOException (java.io.IOException)3 Settings (org.elasticsearch.common.settings.Settings)3 Collections (java.util.Collections)2 HashSet (java.util.HashSet)2 Locale (java.util.Locale)2 Set (java.util.Set)2 NodeClient (org.elasticsearch.client.node.NodeClient)2 ClusterState (org.elasticsearch.cluster.ClusterState)2 ClusterHealthStatus (org.elasticsearch.cluster.health.ClusterHealthStatus)2 Strings (org.elasticsearch.common.Strings)2 RestController (org.elasticsearch.rest.RestController)2 RestRequest (org.elasticsearch.rest.RestRequest)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 ThreadFactoryBuilder (com.google.common.util.concurrent.ThreadFactoryBuilder)1 CrateSettings (io.crate.metadata.settings.CrateSettings)1 URI (java.net.URI)1 UnknownHostException (java.net.UnknownHostException)1 Arrays (java.util.Arrays)1