Search in sources :

Example 6 with JdbcTransactionalStore

use of org.apache.apex.malhar.lib.db.jdbc.JdbcTransactionalStore in project apex-malhar by apache.

the class ExactlyOnceJdbcOutputApp method populateDAG.

@Override
public void populateDAG(DAG dag, Configuration conf) {
    KafkaSinglePortStringInputOperator kafkaInput = dag.addOperator("kafkaInput", new KafkaSinglePortStringInputOperator());
    kafkaInput.setWindowDataManager(new FSWindowDataManager());
    UniqueCounterFlat count = dag.addOperator("count", new UniqueCounterFlat());
    CountStoreOperator store = dag.addOperator("store", new CountStoreOperator());
    store.setStore(new JdbcTransactionalStore());
    ConsoleOutputOperator cons = dag.addOperator("console", new ConsoleOutputOperator());
    dag.addStream("words", kafkaInput.outputPort, count.data);
    dag.addStream("counts", count.counts, store.input, cons.input);
}
Also used : ConsoleOutputOperator(org.apache.apex.malhar.lib.io.ConsoleOutputOperator) JdbcTransactionalStore(org.apache.apex.malhar.lib.db.jdbc.JdbcTransactionalStore) FSWindowDataManager(org.apache.apex.malhar.lib.wal.FSWindowDataManager)

Aggregations

JdbcTransactionalStore (org.apache.apex.malhar.lib.db.jdbc.JdbcTransactionalStore)6 JdbcPOJOInsertOutputOperator (org.apache.apex.malhar.lib.db.jdbc.JdbcPOJOInsertOutputOperator)5 JdbcPOJOInputOperator (org.apache.apex.malhar.lib.db.jdbc.JdbcPOJOInputOperator)2 JdbcStore (org.apache.apex.malhar.lib.db.jdbc.JdbcStore)2 CsvParser (org.apache.apex.malhar.contrib.parser.CsvParser)1 ConsoleOutputOperator (org.apache.apex.malhar.lib.io.ConsoleOutputOperator)1 FSWindowDataManager (org.apache.apex.malhar.lib.wal.FSWindowDataManager)1 TriggerOption (org.apache.apex.malhar.lib.window.TriggerOption)1 WindowOption (org.apache.apex.malhar.lib.window.WindowOption)1