0
votes

With Operator State (or non-keyed state), each operator state is bound to one parallel operator instance

The above quote is from the official Flink website. Each parallel operator instance may have thread pool. When these threads access the Operator State (as described above, each parallel operator instance can have one operator state), would it encounter a thread-safe problem? Should I use Operator State with terminology like below in Java?

synchronize(stateInstance){
//update state
}
1

1 Answers

0
votes

I wonder what do you mean thread pool and how will it interact with Flink managed state?

If the thread pool you mentioned in the question is Flink task running on the Flink TaskManager. Then it is thread-safe. Flink is a distributed system. It executes the task with parallel operator instances, so the managed state of each operator instance is thread-safe naturally.