Hi, I am learning https://ci.apache.org/projects/flink/flink-statefun-docs-release-2.2/getting-started/java_walkthrough.html and wondering if the invoke function is thread safe for:
final int seen = count.getOrDefault(0);count.set(seen + 1); >From >https://ci.apache.org/projects/flink/flink-statefun-docs-release-2.2/concepts/logical.html "When an application starts, each parallel worker of the framework will create one physical object per function type." It sounds like one function can be invoked by multiple workers at the same time. The tutorial example indicates that the persistedValue can be process safe (cross multiple workers) and thread safe (inside a worker, e.g. timer callback). Could you please add some clarification on the questions below? 1. What's the design (briefly) for persisted state process/thread safety? 2. Is there any scenario that the developers need to worry about process/thread safety when using state? 3. can I consider stateful functions as Flink operators so that all operator related theories can be applied to stateful functions? 4. Similarly, can we apply all theories of DataStream state to stateFun's state? Appreciate very much! Thanks Lian On Sun, May 10, 2020 at 9:33 PM Tzu-Li (Gordon) Tai <tzuli...@apache.org> wrote: > As others have mentioned already, it is true that method calls on operators > (e.g. processing events and snapshotting state) will not concurrently > happen. > > As for your findings in reading through the documentation, that might be a > hint that we could add a bit more explanation mentioning this. > Could you suggest where you'd probably expect to see this being mentioned, > based on your readt-hrough? > > Cheers, > Gordon > > > > -- > Sent from: > http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/ > -- Create your own email signature <https://www.wisestamp.com/signature-in-email/?utm_source=promotion&utm_medium=signature&utm_campaign=create_your_own&srcid=5234462839406592>