You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by narasimha <sw...@gmail.com> on 2021/01/27 18:23:32 UTC
How to maintain output order of events by execution initiation time.
Hi,
Below is my dataflow
DataStream stream ...
stream.process(new ProcessFunction())
.sink(...)
class ProcessFunction ...{
MapState<Long, BusinessObject> time ...;
processElement(...){
//add Element to Mapstate by eventtime
// register eventime+60 seconds
}
// Reason for maintaining onTimer in the process function is to update
the timer period.
onTime(timestamp, ...) {
// Iterate over the last n elements added to business objects at a
given timestamp.
// Emit to output if condition passes
}
}
BusinessObject {
List<BusinessEntities> entities;
addEntity(BusinessEntities b);
}
This all looks good on code, but when processing elements with rate of 2k,
the execution result emissions order is changing, i.e,
results of time T+t, are getting emitted first than results of T.
Can someone give suggestions on how this can be handled, so that the
results emissions order is guaranteed.
Would popping them out and emitting using Sliding window of 1 sec would
solve this?
Thanks,
Narasimha
--
A.Narasimha Swamy