public class EsIndexExistsHealthCheck
extends com.codahale.metrics.health.HealthCheck
HealthCheck which checks if one or more indices exist in Elasticsearch.| Constructor and Description |
|---|
EsIndexExistsHealthCheck(org.elasticsearch.client.Client client,
List<String> indices)
Construct a new Elasticsearch index exists health check.
|
EsIndexExistsHealthCheck(org.elasticsearch.client.Client client,
String indexName)
Construct a new Elasticsearch index exists health check.
|
| Modifier and Type | Method and Description |
|---|---|
protected com.codahale.metrics.health.HealthCheck.Result |
check()
Perform a check of the number of documents in the Elasticsearch indices.
|
public EsIndexExistsHealthCheck(org.elasticsearch.client.Client client,
List<String> indices)
client - an Elasticsearch Client instance connected to the clusterindices - a List of indices in Elasticsearch which should be checkedIllegalArgumentException - if indices was null or emptypublic EsIndexExistsHealthCheck(org.elasticsearch.client.Client client,
String indexName)
client - an Elasticsearch Client instance connected to the clusterindexName - the index in Elasticsearch which should be checkedprotected com.codahale.metrics.health.HealthCheck.Result check()
throws Exception
check in class com.codahale.metrics.health.HealthCheckHealthCheck.Result;
otherwise, an unhealthy HealthCheck.Result with a descriptive error
message or exceptionException - if there is an unhandled error during the health check; this will result in
a failed health checkCopyright © 2016. All rights reserved.