Re: Flink Data Stream Union

Posted by flinkuser on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/Flink-Data-Stream-Union-tp3169p3171.html

I need to manipulate the enitre set of data received from both the sockets. I even tried below, which doesnt seem to work.

Just beginning with Flink, not sure what simple thing i'm missing on.

DataStream<String> stockStream =msgDataStream1.union(msgDataStream2);
                                                stockStream.print();

On Mon, Oct 19, 2015 at 11:50 AM, Anwar Rizal [via Apache Flink User Mailing List archive.] <[hidden email]> wrote:
Do you really need to iterate ?

On Mon, Oct 19, 2015 at 5:42 PM, flinkuser <[hidden email]> wrote:

Here is my code snippet but I find the union operator not workable.

DataStream<String> msgDataStream1 = env.addSource((new
SocketSource(hostName1,port,'\n',-1))).filter(new
MessageFilter()).setParallelism(1);
DataStream<String> msgDataStream2 = env.addSource((new
SocketSource(hostName2,port,'\n',-1))).filter(new
MessageFilter()).setParallelism(1);


DataStream<String> stockStream =
(msgDataStream1.union(msgDataStream2)).iterate();
                                                stockStream.print();


The stockStream doesn’t print the consolidated stream data. Sometimes
Stream1 is printed, sometimes none is printed.

Can you please help me out, as of what is wrong here.



--
View this message in context: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Flink-Data-Stream-Union-tp3169.html
Sent from the Apache Flink User Mailing List archive. mailing list archive at Nabble.com.




If you reply to this email, your message will be added to the discussion below:
http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Flink-Data-Stream-Union-tp3169p3170.html
To unsubscribe from Flink Data Stream Union, click here.
NAML



--
Gayu