Hi all,

[first email here, I'm new to Flink, Java and Scala, sorry if I missed 
something obvious]

I'm exploring Flink in the context of streaming calculators. Basically, the 
data flow boils down to multiple data streams with variable update rates (ms, 
seconds, ..., month) which are joined before being fed to calculators. The kind 
of operation I need is very similar to the Rx 
combineLatest<http://reactivex.io/documentation/operators/combinelatest.html> 
operator, which results in a object being emitted whenever one of the streams 
is updated.

As there is no such operator predefined, I think I have to use a GlobalWindow 
and provide a custom WindowAssigner. The end result would look like this 
(pseudo java 8 code, I hope it's understandable):

DataStream<price1> s1 = env.addSource(..);
DataStream<price2> s2 = env.addSource(..);

S3 = s1.join(s2)
.where(s1 -> id)
.equalTo(s2 -> id)
                .window(new MyCustomCombineLatestAssigner())
                .apply( ... return new object combining data from s1 and from 
s2);

Is the approach correct, or is there a simpler way to achieve the same join + 
apply mechanism ?

Thank you,

Denis



________________________________

This e-mail is for the sole use of the intended recipient and contains 
information that may be privileged and/or confidential. If you are not an 
intended recipient, please notify the sender by return e-mail and delete this 
e-mail and any attachments. Certain required legal entity disclosures can be 
accessed on our website.<http://site.thomsonreuters.com/site/disclosures/>

Reply via email to