use of org.apache.apex.malhar.contrib.nifi.NiFiSinglePortOutputOperator in project apex-malhar by apache.
the class TestNiFiOutputApplication method populateDAG.
@Override
public void populateDAG(DAG dag, Configuration conf) {
final SiteToSiteClientConfig clientConfig = new SiteToSiteClient.Builder().url("http://localhost:8080/nifi").portName("Apex").buildConfig();
final int batchSize = 1;
final SiteToSiteClient.Builder builder = new SiteToSiteClient.Builder().fromConfig(clientConfig);
final NiFiDataPacketBuilder<String> dataPacketBuilder = new StringNiFiDataPacketBuilder();
final WindowDataManager windowDataManager = new WindowDataManager.NoopWindowDataManager();
RandomEventGenerator rand = dag.addOperator("rand", new RandomEventGenerator());
NiFiSinglePortOutputOperator nifi = dag.addOperator("nifi", new NiFiSinglePortOutputOperator(builder, dataPacketBuilder, windowDataManager, batchSize));
dag.addStream("rand_nifi", rand.string_data, nifi.inputPort).setLocality(null);
}
Aggregations