Search in sources :

Example 1 with NiFiSinglePortOutputOperator

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);
}
Also used : SiteToSiteClient(org.apache.nifi.remote.client.SiteToSiteClient) NiFiSinglePortOutputOperator(org.apache.apex.malhar.contrib.nifi.NiFiSinglePortOutputOperator) SiteToSiteClientConfig(org.apache.nifi.remote.client.SiteToSiteClientConfig) WindowDataManager(org.apache.apex.malhar.lib.wal.WindowDataManager) RandomEventGenerator(org.apache.apex.malhar.lib.testbench.RandomEventGenerator)

Aggregations

NiFiSinglePortOutputOperator (org.apache.apex.malhar.contrib.nifi.NiFiSinglePortOutputOperator)1 RandomEventGenerator (org.apache.apex.malhar.lib.testbench.RandomEventGenerator)1 WindowDataManager (org.apache.apex.malhar.lib.wal.WindowDataManager)1 SiteToSiteClient (org.apache.nifi.remote.client.SiteToSiteClient)1 SiteToSiteClientConfig (org.apache.nifi.remote.client.SiteToSiteClientConfig)1