use of streamer.debug.FakeSink in project cloudstack by apache.
the class Queue method main.
/**
* Example.
*/
public static void main(String[] args) {
// System.setProperty("streamer.Link.debug", "true");
System.setProperty("streamer.Element.debug", "true");
Element source1 = new FakeSource("source1") {
{
delay = 100;
numBuffers = 10;
incommingBufLength = 10;
}
};
Element source2 = new FakeSource("source2") {
{
delay = 100;
numBuffers = 10;
incommingBufLength = 10;
}
};
Pipeline pipeline = new PipelineImpl("test");
pipeline.add(source1);
pipeline.add(source2);
pipeline.add(new Queue("queue"));
pipeline.add(new FakeSink("sink"));
// Main flow
pipeline.link("source1", "in1< queue");
pipeline.link("source2", "in2< queue");
pipeline.link("queue", "sink");
new Thread(pipeline.getLink("source1", STDOUT)).start();
new Thread(pipeline.getLink("source2", STDOUT)).start();
pipeline.getLink("sink", STDIN).run();
}
Aggregations