Search in sources :

Example 1 with TrackedMultiOutputTransform

use of co.cask.cdap.etl.common.TrackedMultiOutputTransform in project cdap by caskdata.

the class MapReduceTransformExecutorFactory method getMultiOutputTransform.

private <IN, ERROR> TrackedMultiOutputTransform<IN, ERROR> getMultiOutputTransform(StageSpec stageSpec) throws Exception {
    String stageName = stageSpec.getName();
    DefaultMacroEvaluator macroEvaluator = new DefaultMacroEvaluator(arguments, taskContext.getLogicalStartTime(), taskContext, taskContext.getNamespace());
    SplitterTransform<IN, ERROR> splitterTransform = pluginInstantiator.newPluginInstance(stageName, macroEvaluator);
    TransformContext transformContext = createRuntimeContext(stageSpec);
    splitterTransform.initialize(transformContext);
    StageMetrics stageMetrics = new DefaultStageMetrics(metrics, stageName);
    TaskAttemptContext taskAttemptContext = (TaskAttemptContext) taskContext.getHadoopContext();
    StageStatisticsCollector collector = isPipelineContainsCondition ? new MapReduceStageStatisticsCollector(stageName, taskAttemptContext) : new NoopStageStatisticsCollector();
    return new TrackedMultiOutputTransform<>(splitterTransform, stageMetrics, taskContext.getDataTracer(stageName), collector);
}
Also used : NoopStageStatisticsCollector(co.cask.cdap.etl.common.NoopStageStatisticsCollector) TaskAttemptContext(org.apache.hadoop.mapreduce.TaskAttemptContext) TrackedMultiOutputTransform(co.cask.cdap.etl.common.TrackedMultiOutputTransform) TransformContext(co.cask.cdap.etl.api.TransformContext) NoopStageStatisticsCollector(co.cask.cdap.etl.common.NoopStageStatisticsCollector) StageStatisticsCollector(co.cask.cdap.etl.common.StageStatisticsCollector) DefaultMacroEvaluator(co.cask.cdap.etl.common.DefaultMacroEvaluator) StageMetrics(co.cask.cdap.etl.api.StageMetrics) DefaultStageMetrics(co.cask.cdap.etl.common.DefaultStageMetrics) DefaultStageMetrics(co.cask.cdap.etl.common.DefaultStageMetrics)

Aggregations

StageMetrics (co.cask.cdap.etl.api.StageMetrics)1 TransformContext (co.cask.cdap.etl.api.TransformContext)1 DefaultMacroEvaluator (co.cask.cdap.etl.common.DefaultMacroEvaluator)1 DefaultStageMetrics (co.cask.cdap.etl.common.DefaultStageMetrics)1 NoopStageStatisticsCollector (co.cask.cdap.etl.common.NoopStageStatisticsCollector)1 StageStatisticsCollector (co.cask.cdap.etl.common.StageStatisticsCollector)1 TrackedMultiOutputTransform (co.cask.cdap.etl.common.TrackedMultiOutputTransform)1 TaskAttemptContext (org.apache.hadoop.mapreduce.TaskAttemptContext)1