use of org.apache.heron.streamlet.Builder in project heron by twitter.
the class StreamletWithFilterAndTransform method buildTopology.
@Override
protected TestTopologyBuilder buildTopology(TestTopologyBuilder testTopologyBuilder) {
AtomicInteger atomicInteger = new AtomicInteger(0);
Builder streamletBuilder = Builder.newBuilder();
streamletBuilder.newSource(() -> atomicInteger.getAndIncrement()).setName("incremented-numbers").filter(i -> i <= 7).setName("numbers-lower-than-8").transform(new TextTransformer()).setName("numbers-transformed-to-text");
BuilderImpl streamletBuilderImpl = (BuilderImpl) streamletBuilder;
TestTopologyBuilder topology = (TestTopologyBuilder) streamletBuilderImpl.build(testTopologyBuilder);
return topology;
}
Aggregations