Brian Z
Brian Z

Reputation: 99

Flink: does state access across stream?

I have one stream is going to store the state, and I hope another stream can retrieve the state. Is this possible?

I have tried in my unit test that seems like doesn't work.

Upvotes: 0

Views: 183

Answers (2)

kkrugler
kkrugler

Reputation: 9245

Depending on how you need to use the state, it might be possible to leverage queryable state to share it with another stream.

Upvotes: 0

Till Rohrmann
Till Rohrmann

Reputation: 13346

It is currently not possible that different streams share state. Even different operators which belong to the same stream are not able to share state.

The only thing you could play with is to use static fields to share state across different threads and thus also streams. But this only works if different tasks are executed by the same TaskManager and, thus, run in the same JVM.

Upvotes: 1

Related Questions