class HiveMultipleMetastoreCheck extends AbstractCheckDescriptor {

  @Override
  public void perform(PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest request) throws AmbariException {
    final String clusterName = request.getClusterName();
    final Cluster cluster = clustersProvider.get().getCluster(clusterName);

    try {
      Service hive = cluster.getService("HIVE");
      ServiceComponent metastore = hive.getServiceComponent("HIVE_METASTORE");
      Map<String, ServiceComponentHost> metastores = metastore.getServiceComponentHosts();

      if (metastores.size() < 2) {
        prerequisiteCheck.getFailedOn().add("HIVE");
        prerequisiteCheck.setStatus(PrereqCheckStatus.WARNING);
        prerequisiteCheck.setFailReason(getFailReason(prerequisiteCheck, request));
      }
    } catch (ServiceComponentNotFoundException scnfe) {
      prerequisiteCheck.getFailedOn().add("HIVE");
      prerequisiteCheck.setStatus(PrereqCheckStatus.WARNING);
      prerequisiteCheck.setFailReason(getFailReason(prerequisiteCheck, request));
    }
  }

  public  HiveMultipleMetastoreCheck();

}