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();
}
Aggregations