java.lang.Object
org.elasticsearch.health.HealthService
This service collects health indicators from all modules and plugins of elasticsearch
-
Constructor Summary
ConstructorDescriptionHealthService
(List<HealthIndicatorService> preflightHealthIndicatorServices, List<HealthIndicatorService> healthIndicatorServices) Creates a new HealthService. -
Method Summary
Modifier and TypeMethodDescriptionReturns the list of HealthIndicatorResult for this cluster.
-
Constructor Details
-
HealthService
public HealthService(List<HealthIndicatorService> preflightHealthIndicatorServices, List<HealthIndicatorService> healthIndicatorServices) Creates a new HealthService. Accepts a list of regular indicator services and a list of preflight indicator services. Preflight indicators are run first and represent serious cascading health problems. If any of these preflight indicators are not GREEN status, all remaining indicators are likely to be degraded in some way or will not be able to calculate their state correctly. The remaining health indicators will return UNKNOWN statuses in this case.- Parameters:
preflightHealthIndicatorServices
- indicators that are run first and represent a serious cascading health problem.healthIndicatorServices
- indicators that are run if the preflight indicators return GREEN results.
-
-
Method Details
-
getHealth
Returns the list of HealthIndicatorResult for this cluster.- Parameters:
indicatorName
- If not null, the returned results will only have this indicatorexplain
- Whether to compute the details portion of the results- Returns:
- A list of all HealthIndicatorResult if indicatorName is null, or one HealthIndicatorResult if indicatorName is not null
- Throws:
ResourceNotFoundException
- if an indicator name is given and the indicator is not found
-