use of io.cdap.cdap.etl.common.TrackedTransform in project cdap by caskdata.
the class TransformExecutorFactory method getTransformation.
@SuppressWarnings("unchecked")
protected <IN, OUT> TrackedTransform<IN, OUT> getTransformation(StageSpec stageSpec) throws Exception {
String stageName = stageSpec.getName();
String pluginType = stageSpec.getPluginType();
StageMetrics stageMetrics = new DefaultStageMetrics(metrics, stageName);
StageStatisticsCollector collector = collectStageStatistics ? getStatisticsCollector(stageName) : NoopStageStatisticsCollector.INSTANCE;
Transformation transformation = getInitializedTransformation(stageSpec);
// we emit metrics for records into alert publishers when the actual alerts are published,
// not when we write the alerts to the temporary dataset
String recordsInMetric = AlertPublisher.PLUGIN_TYPE.equals(pluginType) ? null : Constants.Metrics.RECORDS_IN;
return new TrackedTransform<>(transformation, stageMetrics, recordsInMetric, Constants.Metrics.RECORDS_OUT, getDataTracer(stageName), collector);
}
Aggregations