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);
}
Aggregations