public void reportFailoverStart(String stageName, Map<String, Long> metricMap,
                                  FailoverMetaData failoverMd, String failoverEndpoint,
                                  String failoverType) throws SemanticException {
    if (isEnabled) {
      LOG.info("Failover Stage Started {}, {}, {}", stageName, metricMap.size(), metricMap);
      Progress progress = replicationMetric.getProgress();
      progress.setStatus(Status.FAILOVER_IN_PROGRESS);
      Stage stage = new Stage(stageName, Status.IN_PROGRESS, getCurrentTimeInMillis());
      for (Map.Entry<String, Long> metric : metricMap.entrySet()) {
        stage.addMetric(new Metric(metric.getKey(), metric.getValue()));
      }
      progress.addStage(stage);
      replicationMetric.setProgress(progress);
      Metadata metadata = replicationMetric.getMetadata();
      metadata.setFailoverMetadataLoc(failoverMd.getFilePath());
      metadata.setFailoverEventId(failoverMd.getFailoverEventId());
      metadata.setFailoverEndPoint(failoverEndpoint);
      metadata.setFailoverType(failoverType);
      replicationMetric.setMetadata(metadata);
      metricCollector.addMetric(replicationMetric);
    }
  }
Abstract class for Replication Metric Collection.
ql/src/java/org/apache/hadoop/hive/ql/parse/repl/metric/ReplicationMetricCollector.java