Search in sources :

Example 1 with FSRecordReaderModule

use of org.apache.apex.malhar.lib.fs.FSRecordReaderModule in project apex-malhar by apache.

the class Application method populateDAG.

public void populateDAG(DAG dag, Configuration conf) {
    FSRecordReaderModule recordReader = dag.addModule("lineInput", FSRecordReaderModule.class);
    S3BytesOutputModule s3StringOutputModule = dag.addModule("s3TupleOutput", S3BytesOutputModule.class);
    dag.addStream("data", recordReader.records, s3StringOutputModule.input);
}
Also used : FSRecordReaderModule(org.apache.apex.malhar.lib.fs.FSRecordReaderModule) S3BytesOutputModule(org.apache.apex.malhar.lib.fs.s3.S3TupleOutputModule.S3BytesOutputModule)

Example 2 with FSRecordReaderModule

use of org.apache.apex.malhar.lib.fs.FSRecordReaderModule in project apex-malhar by apache.

the class Application method populateDAG.

@Override
public void populateDAG(DAG dag, Configuration conf) {
    FSRecordReaderModule recordReader = dag.addModule("recordReader", FSRecordReaderModule.class);
    CsvParser csvParser = dag.addOperator("csvParser", CsvParser.class);
    CsvFormatter formatter = dag.addOperator("formatter", new CsvFormatter());
    StringFileOutputOperator fileOutput = dag.addOperator("fileOutput", new StringFileOutputOperator());
    dag.addStream("record", recordReader.records, csvParser.in);
    dag.addStream("pojo", csvParser.out, formatter.in);
    dag.addStream("string", formatter.out, fileOutput.input);
}
Also used : FSRecordReaderModule(org.apache.apex.malhar.lib.fs.FSRecordReaderModule) CsvFormatter(org.apache.apex.malhar.contrib.formatter.CsvFormatter) CsvParser(org.apache.apex.malhar.contrib.parser.CsvParser) StringFileOutputOperator(org.apache.apex.malhar.lib.fs.GenericFileOutputOperator.StringFileOutputOperator)

Example 3 with FSRecordReaderModule

use of org.apache.apex.malhar.lib.fs.FSRecordReaderModule in project apex-malhar by apache.

the class Application method populateDAG.

@Override
public void populateDAG(DAG dag, Configuration conf) {
    FSRecordReaderModule recordReader = dag.addModule("recordReader", FSRecordReaderModule.class);
    CsvParser csvParser = dag.addOperator("csvParser", CsvParser.class);
    FilterOperator filterOperator = dag.addOperator("filterOperator", new FilterOperator());
    CsvFormatter selectedFormatter = dag.addOperator("selectedFormatter", new CsvFormatter());
    CsvFormatter rejectedFormatter = dag.addOperator("rejectedFormatter", new CsvFormatter());
    StringFileOutputOperator selectedOutput = dag.addOperator("selectedOutput", new StringFileOutputOperator());
    StringFileOutputOperator rejectedOutput = dag.addOperator("rejectedOutput", new StringFileOutputOperator());
    dag.addStream("record", recordReader.records, csvParser.in);
    dag.addStream("pojo", csvParser.out, filterOperator.input);
    dag.addStream("pojoSelected", filterOperator.truePort, selectedFormatter.in);
    dag.addStream("pojoRejected", filterOperator.falsePort, rejectedFormatter.in);
    dag.addStream("csvSelected", selectedFormatter.out, selectedOutput.input);
    dag.addStream("csvRejected", rejectedFormatter.out, rejectedOutput.input);
}
Also used : FilterOperator(org.apache.apex.malhar.lib.filter.FilterOperator) FSRecordReaderModule(org.apache.apex.malhar.lib.fs.FSRecordReaderModule) CsvFormatter(org.apache.apex.malhar.contrib.formatter.CsvFormatter) CsvParser(org.apache.apex.malhar.contrib.parser.CsvParser) StringFileOutputOperator(org.apache.apex.malhar.lib.fs.GenericFileOutputOperator.StringFileOutputOperator)

Aggregations

FSRecordReaderModule (org.apache.apex.malhar.lib.fs.FSRecordReaderModule)3 CsvFormatter (org.apache.apex.malhar.contrib.formatter.CsvFormatter)2 CsvParser (org.apache.apex.malhar.contrib.parser.CsvParser)2 StringFileOutputOperator (org.apache.apex.malhar.lib.fs.GenericFileOutputOperator.StringFileOutputOperator)2 FilterOperator (org.apache.apex.malhar.lib.filter.FilterOperator)1 S3BytesOutputModule (org.apache.apex.malhar.lib.fs.s3.S3TupleOutputModule.S3BytesOutputModule)1