Dhinesh
Dhinesh

Reputation: 325

How to create datastream from a file data in flink in the same order as the data is written in file ?

I am using flink to read a data from the file and converting it to stream and then process the stream.But when I read the data from the file and converted it to stream, the content in the data stream thus formed is not in the same order as the data order in the file. According to my requirement the order of the data in the file and in the stream is important. Could anyone help me in this? Thanks

Upvotes: 1

Views: 789

Answers (1)

Andrew Gao
Andrew Gao

Reputation: 76

I had this problem when I was combining multiple streams and was able to resolve it by using the following:

    DataStream<T> stream;
    stream.setParallelism(1).rebalance();

Upvotes: 2

Related Questions