Search in sources :

Example 1 with RandomWordGenerator

use of org.apache.apex.malhar.lib.testbench.RandomWordGenerator in project apex-malhar by apache.

the class FSOutputOperatorBenchmark method populateDAG.

@Override
public void populateDAG(DAG dag, Configuration conf) {
    String filePath = "HDFSOutputOperatorBenchmarkingApp/" + System.currentTimeMillis();
    dag.setAttribute(DAG.STREAMING_WINDOW_SIZE_MILLIS, 1000);
    RandomWordGenerator wordGenerator = dag.addOperator("wordGenerator", RandomWordGenerator.class);
    dag.getOperatorMeta("wordGenerator").getMeta(wordGenerator.output).getAttributes().put(PortContext.QUEUE_CAPACITY, 10000);
    dag.getOperatorMeta("wordGenerator").getAttributes().put(OperatorContext.APPLICATION_WINDOW_COUNT, 1);
    FSByteOutputOperator hdfsOutputOperator = dag.addOperator("hdfsOutputOperator", new FSByteOutputOperator());
    hdfsOutputOperator.setFilePath(filePath);
    dag.getOperatorMeta("hdfsOutputOperator").getAttributes().put(OperatorContext.COUNTERS_AGGREGATOR, new BasicCounters.LongAggregator<MutableLong>());
    dag.addStream("Generator2HDFSOutput", wordGenerator.output, hdfsOutputOperator.input);
}
Also used : RandomWordGenerator(org.apache.apex.malhar.lib.testbench.RandomWordGenerator) BasicCounters(org.apache.apex.malhar.lib.counters.BasicCounters) MutableLong(org.apache.commons.lang.mutable.MutableLong)

Aggregations

BasicCounters (org.apache.apex.malhar.lib.counters.BasicCounters)1 RandomWordGenerator (org.apache.apex.malhar.lib.testbench.RandomWordGenerator)1 MutableLong (org.apache.commons.lang.mutable.MutableLong)1