@ Override protected Result check ( ) throws Exception { final ClusterHealthStatus status = client . admin ( ) . cluster ( ) . prepareHealth ( ) . get ( ) . getStatus ( ) ; if ( status == ClusterHealthStatus . RED || ( failOnYellow && status == ClusterHealthStatus . YELLOW ) ) { return Result . unhealthy ( "Last status: %s" , status . name ( ) ) ; } else { return Result . healthy ( "Last status: %s" , status . name ( ) ) ; } }
Perform a check of the Elasticsearch cluster health .