Class HealthService

java.lang.Object
org.elasticsearch.health.HealthService

public class HealthService extends Object
This service collects health indicators from all modules and plugins of elasticsearch
  • Field Details

  • 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

      public void getHealth(Client client, @Nullable String indicatorName, boolean explain, ActionListener<List<HealthIndicatorResult>> listener)
      Returns the list of HealthIndicatorResult for this cluster.
      Parameters:
      client - A client to be used to fetch the health data from the health node
      indicatorName - If not null, the returned results will only have this indicator
      explain - Whether to compute the details portion of the results
      listener - A listener to be notified of the 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