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> healthIndicatorServices, ThreadPool threadPool)
      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.
  • Method Details

    • getHealth

      public void getHealth(Client client, @Nullable String indicatorName, boolean verbose, int maxAffectedResourcesCount, 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
      verbose - 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
      maxAffectedResourcesCount - The maximum number of affected resources to return per each type.
      Throws:
      ResourceNotFoundException - if an indicator name is given and the indicator is not found