Search in sources :

Example 1 with BasicOutputFormatProvider

use of co.cask.cdap.internal.app.runtime.batch.BasicOutputFormatProvider in project cdap by caskdata.

the class MockExternalSink method prepareRun.

@Override
public void prepareRun(BatchSinkContext context) throws Exception {
    OutputFormatProvider outputFormatProvider = new BasicOutputFormatProvider(TextOutputFormat.class.getCanonicalName(), ImmutableMap.of(TextOutputFormat.OUTDIR, config.dirName));
    if (config.name != null) {
        Output output = Output.of(config.name, outputFormatProvider);
        output.alias(config.alias);
        context.addOutput(output);
    } else {
        context.addOutput(Output.of(config.alias, outputFormatProvider));
    }
}
Also used : TextOutputFormat(org.apache.hadoop.mapreduce.lib.output.TextOutputFormat) Output(co.cask.cdap.api.data.batch.Output) BasicOutputFormatProvider(co.cask.cdap.internal.app.runtime.batch.BasicOutputFormatProvider) OutputFormatProvider(co.cask.cdap.api.data.batch.OutputFormatProvider) BasicOutputFormatProvider(co.cask.cdap.internal.app.runtime.batch.BasicOutputFormatProvider)

Aggregations

Output (co.cask.cdap.api.data.batch.Output)1 OutputFormatProvider (co.cask.cdap.api.data.batch.OutputFormatProvider)1 BasicOutputFormatProvider (co.cask.cdap.internal.app.runtime.batch.BasicOutputFormatProvider)1 TextOutputFormat (org.apache.hadoop.mapreduce.lib.output.TextOutputFormat)1