use of com.datatorrent.api.StreamingApplication in project apex-malhar by apache.
the class WindowedOperatorBenchmarkAppTest method test.
@Test
public void test() throws Exception {
Configuration conf = new Configuration(false);
LocalMode lma = LocalMode.newInstance();
DAG dag = lma.getDAG();
super.populateDAG(dag, conf);
StreamingApplication app = new StreamingApplication() {
@Override
public void populateDAG(DAG dag, Configuration conf) {
}
};
lma.prepareDAG(app, conf);
// Create local cluster
final LocalMode.Controller lc = lma.getController();
lc.run(3000000);
lc.shutdown();
}
use of com.datatorrent.api.StreamingApplication in project apex-malhar by apache.
the class TestNiFiOutputApplication method main.
public static void main(String[] args) throws Exception {
StreamingApplication app = new TestNiFiOutputApplication();
LocalMode.runApp(app, new Configuration(false), 10000);
Thread.sleep(2000);
System.exit(0);
}
use of com.datatorrent.api.StreamingApplication in project apex-malhar by apache.
the class SliceBloomFilterTest method testBloomFilterForApplication.
/**
* Just test SliceBloomFilter can be used by operator. such as it is serializable etc
* @throws Exception
*/
@Test
public void testBloomFilterForApplication() throws Exception {
Configuration conf = new Configuration(false);
LocalMode lma = LocalMode.newInstance();
DAG dag = lma.getDAG();
TestInputOperator generator = new TestInputOperator();
dag.addOperator("Generator", generator);
FilterOperator filterOperator = new FilterOperator();
dag.addOperator("filterOperator", filterOperator);
dag.addStream("Data", generator.data, filterOperator.input).setLocality(Locality.CONTAINER_LOCAL);
StreamingApplication app = new StreamingApplication() {
@Override
public void populateDAG(DAG dag, Configuration conf) {
}
};
lma.prepareDAG(app, conf);
// Create local cluster
final LocalMode.Controller lc = lma.getController();
lc.run(3000);
lc.shutdown();
}
use of com.datatorrent.api.StreamingApplication in project apex-malhar by apache.
the class SmtpOutputOperatorTest method testProperties.
@Test
public void testProperties() throws Exception {
Configuration conf = new Configuration(false);
conf.set(StreamingApplication.DT_PREFIX + "operator.o1.prop.subject", subject);
conf.set(StreamingApplication.DT_PREFIX + "operator.o1.prop.content", content);
conf.set(StreamingApplication.DT_PREFIX + "operator.o1.prop.from", from);
conf.set(StreamingApplication.DT_PREFIX + "operator.o1.prop.smtpHost", "127.0.0.1");
conf.set(StreamingApplication.DT_PREFIX + "operator.o1.prop.smtpUserName", from);
conf.set(StreamingApplication.DT_PREFIX + "operator.o1.prop.smtpPassword", "<password>");
conf.set(StreamingApplication.DT_PREFIX + "operator.o1.prop.recipients.TO", to + "," + cc);
conf.set(StreamingApplication.DT_PREFIX + "operator.o1.prop.recipients.CC", cc);
final AtomicReference<SmtpOutputOperator> o1 = new AtomicReference<SmtpOutputOperator>();
StreamingApplication app = new StreamingApplication() {
@Override
public void populateDAG(DAG dag, Configuration conf) {
o1.set(dag.addOperator("o1", new SmtpOutputOperator()));
}
};
LocalMode lma = LocalMode.newInstance();
lma.prepareDAG(app, conf);
Assert.assertEquals("checking TO list", to + "," + cc, o1.get().getRecipients().get("TO"));
Assert.assertEquals("checking CC list", cc, o1.get().getRecipients().get("CC"));
}
Aggregations