Search in sources :

Example 1 with NoOpReplStatsTracker

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);
        }
    }
}
Also used : Progress(org.apache.hadoop.hive.ql.parse.repl.metric.event.Progress) NoOpReplStatsTracker(org.apache.hadoop.hive.ql.exec.repl.NoOpReplStatsTracker) Metadata(org.apache.hadoop.hive.ql.parse.repl.metric.event.Metadata) Stage(org.apache.hadoop.hive.ql.parse.repl.metric.event.Stage)

Aggregations

NoOpReplStatsTracker (org.apache.hadoop.hive.ql.exec.repl.NoOpReplStatsTracker)1 Metadata (org.apache.hadoop.hive.ql.parse.repl.metric.event.Metadata)1 Progress (org.apache.hadoop.hive.ql.parse.repl.metric.event.Progress)1 Stage (org.apache.hadoop.hive.ql.parse.repl.metric.event.Stage)1