Hi Dominik,
the reason why the AsyncFunction does not support state atm is that we
would to have make sure that the right key is set not only when open and
asyncInvoke is set but also when a potential asynchronous callback is being
executed. It would be super easy to define a callback which keeps a
reference to the state object. If the right key is not set when the
callback is being executed, then you easily can corrupt your state.
Moreover, all state accesses need to run under the checkpoint lock. Due to
these problems, we decided to not support state for AsyncFunctions. Said
differently, if state accesses would set the right key and execute under
the checkpoint lock, then one could support state for AsyncFunctions.
Cheers,
Till
On Tue, Apr 30, 2019 at 12:20 PM Dominik Wosiński <
[hidden email]> wrote:
> Hey, Currently when trying to get the state inside the *open* method for
> Flink RichAsyncFunction we will get *State is not supported in rich async
> functions *exception.Why doesn't AsyncFunction support state ?
>
> Thanks in advance,
> Best Regards,
> Dom.
>