use of org.apache.hadoop.hive.ql.exec.repl.NoOpReplStatsTracker in project hive by apache.
the class ReplicationMetricCollector method reportStageEnd.
public void reportStageEnd(String stageName, Status status, long lastReplId, SnapshotUtils.ReplSnapshotCount replSnapshotCount, ReplStatsTracker replStatsTracker) throws SemanticException {
unRegisterMBeanSafe();
if (isEnabled) {
LOG.debug("Stage ended {}, {}, {}", stageName, status, lastReplId);
Progress progress = replicationMetric.getProgress();
Stage stage = progress.getStageByName(stageName);
if (stage == null) {
stage = new Stage(stageName, status, -1L);
}
stage.setStatus(status);
stage.setEndTime(getCurrentTimeInMillis());
stage.setReplSnapshotsCount(replSnapshotCount);
if (replStatsTracker != null && !(replStatsTracker instanceof NoOpReplStatsTracker)) {
String replStatString = replStatsTracker.toString();
LOG.info("Replication Statistics are: {}", replStatString);
stage.setReplStats(replStatString);
}
progress.addStage(stage);
replicationMetric.setProgress(progress);
Metadata metadata = replicationMetric.getMetadata();
metadata.setLastReplId(lastReplId);
replicationMetric.setMetadata(metadata);
metricCollector.addMetric(replicationMetric);
if (Status.FAILED == status || Status.FAILED_ADMIN == status) {
reportEnd(status);
}
}
}
Aggregations