class DruidHighAvailabilityCheck extends AbstractCheckDescriptor {

  @Override
  public void perform(PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest request) throws AmbariException
  {
    List<String> haNotEnabledComponents = Lists.newArrayList();
    for (String component : DRUID_COMPONENT_NAMES) {
      Set<String> hosts = getHostsForComponent(request, component);
      if (hosts.size() == 1) {
        // This component is installed on only 1 host, HA is not enabled for it.
        haNotEnabledComponents.add(component);
      }
    }
    if (!haNotEnabledComponents.isEmpty()) {
      prerequisiteCheck.getFailedOn().add(DRUID_SERVICE_NAME);
      prerequisiteCheck.setStatus(PrereqCheckStatus.WARNING);
      String failReason = getFailReason(prerequisiteCheck, request);
      prerequisiteCheck.setFailReason(String.format(failReason, StringUtils.join(haNotEnabledComponents.toArray(), ", ")));
    }

  }

  public  DruidHighAvailabilityCheck();

}