Search in sources :

Example 1 with FTPStringInputOperator

use of org.apache.apex.malhar.lib.io.AbstractFTPInputOperator.FTPStringInputOperator in project apex-malhar by apache.

the class Application method populateDAG.

@Override
public void populateDAG(DAG dag, Configuration conf) {
    // ftp read operator. Configuration through resources/META-INF/properties.xml
    FTPStringInputOperator reader = dag.addOperator("Reader", new FTPStringInputOperator());
    // Set properties for the FTP input operator
    reader.setHost("localhost");
    reader.setUserName("ftp");
    reader.setDirectory("sourceDir");
    reader.setPartitionCount(2);
    // writer that writes strings to a file on hdfs
    StringFileOutputOperator writer = dag.addOperator("Writer", new StringFileOutputOperator());
    // Set properties for the output operator
    writer.setFilePath("malhar_examples/ftp");
    writer.setFilePath("destination");
    // Connect reader output to writer
    dag.addStream("data", reader.output, writer.input);
}
Also used : FTPStringInputOperator(org.apache.apex.malhar.lib.io.AbstractFTPInputOperator.FTPStringInputOperator) StringFileOutputOperator(org.apache.apex.malhar.lib.fs.GenericFileOutputOperator.StringFileOutputOperator)

Aggregations

StringFileOutputOperator (org.apache.apex.malhar.lib.fs.GenericFileOutputOperator.StringFileOutputOperator)1 FTPStringInputOperator (org.apache.apex.malhar.lib.io.AbstractFTPInputOperator.FTPStringInputOperator)1