Search in sources :

Example 1 with Transformation

use of io.cdap.cdap.etl.api.Transformation 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);
}
Also used : TrackedTransform(io.cdap.cdap.etl.common.TrackedTransform) Transformation(io.cdap.cdap.etl.api.Transformation) StageStatisticsCollector(io.cdap.cdap.etl.common.StageStatisticsCollector) NoopStageStatisticsCollector(io.cdap.cdap.etl.common.NoopStageStatisticsCollector) StageMetrics(io.cdap.cdap.etl.api.StageMetrics) DefaultStageMetrics(io.cdap.cdap.etl.common.DefaultStageMetrics) DefaultStageMetrics(io.cdap.cdap.etl.common.DefaultStageMetrics)

Aggregations

StageMetrics (io.cdap.cdap.etl.api.StageMetrics)1 Transformation (io.cdap.cdap.etl.api.Transformation)1 DefaultStageMetrics (io.cdap.cdap.etl.common.DefaultStageMetrics)1 NoopStageStatisticsCollector (io.cdap.cdap.etl.common.NoopStageStatisticsCollector)1 StageStatisticsCollector (io.cdap.cdap.etl.common.StageStatisticsCollector)1 TrackedTransform (io.cdap.cdap.etl.common.TrackedTransform)1