Search in sources :

Example 1 with ErrorTransform

use of co.cask.cdap.etl.api.ErrorTransform in project cdap by caskdata.

the class PipelinePluginContext method wrapPlugin.

private Object wrapPlugin(String pluginId, Object plugin) {
    Caller caller = getCaller(pluginId);
    StageMetrics stageMetrics = new DefaultStageMetrics(metrics, pluginId);
    OperationTimer operationTimer = processTimingEnabled ? new MetricsOperationTimer(stageMetrics) : NoOpOperationTimer.INSTANCE;
    if (plugin instanceof Action) {
        return new WrappedAction((Action) plugin, caller);
    } else if (plugin instanceof BatchSource) {
        return new WrappedBatchSource<>((BatchSource) plugin, caller, operationTimer);
    } else if (plugin instanceof BatchSink) {
        return new WrappedBatchSink<>((BatchSink) plugin, caller, operationTimer);
    } else if (plugin instanceof ErrorTransform) {
        return new WrappedErrorTransform<>((ErrorTransform) plugin, caller, operationTimer);
    } else if (plugin instanceof Transform) {
        return new WrappedTransform<>((Transform) plugin, caller, operationTimer);
    } else if (plugin instanceof BatchAggregator) {
        return new WrappedBatchAggregator<>((BatchAggregator) plugin, caller, operationTimer);
    } else if (plugin instanceof BatchJoiner) {
        return new WrappedBatchJoiner<>((BatchJoiner) plugin, caller, operationTimer);
    } else if (plugin instanceof PostAction) {
        return new WrappedPostAction((PostAction) plugin, caller);
    } else if (plugin instanceof SplitterTransform) {
        return new WrappedSplitterTransform<>((SplitterTransform) plugin, caller, operationTimer);
    }
    return wrapUnknownPlugin(pluginId, plugin, caller);
}
Also used : Action(co.cask.cdap.etl.api.action.Action) PostAction(co.cask.cdap.etl.api.batch.PostAction) BatchSource(co.cask.cdap.etl.api.batch.BatchSource) SplitterTransform(co.cask.cdap.etl.api.SplitterTransform) BatchJoiner(co.cask.cdap.etl.api.batch.BatchJoiner) ErrorTransform(co.cask.cdap.etl.api.ErrorTransform) BatchAggregator(co.cask.cdap.etl.api.batch.BatchAggregator) BatchSink(co.cask.cdap.etl.api.batch.BatchSink) StageMetrics(co.cask.cdap.etl.api.StageMetrics) DefaultStageMetrics(co.cask.cdap.etl.common.DefaultStageMetrics) PostAction(co.cask.cdap.etl.api.batch.PostAction) ErrorTransform(co.cask.cdap.etl.api.ErrorTransform) Transform(co.cask.cdap.etl.api.Transform) SplitterTransform(co.cask.cdap.etl.api.SplitterTransform) DefaultStageMetrics(co.cask.cdap.etl.common.DefaultStageMetrics)

Aggregations

ErrorTransform (co.cask.cdap.etl.api.ErrorTransform)1 SplitterTransform (co.cask.cdap.etl.api.SplitterTransform)1 StageMetrics (co.cask.cdap.etl.api.StageMetrics)1 Transform (co.cask.cdap.etl.api.Transform)1 Action (co.cask.cdap.etl.api.action.Action)1 BatchAggregator (co.cask.cdap.etl.api.batch.BatchAggregator)1 BatchJoiner (co.cask.cdap.etl.api.batch.BatchJoiner)1 BatchSink (co.cask.cdap.etl.api.batch.BatchSink)1 BatchSource (co.cask.cdap.etl.api.batch.BatchSource)1 PostAction (co.cask.cdap.etl.api.batch.PostAction)1 DefaultStageMetrics (co.cask.cdap.etl.common.DefaultStageMetrics)1