You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by shimin yang <ys...@gmail.com> on 2018/10/19 06:36:50 UTC

State access in RichAsyncFunction

Hi all,

Regarding to the RichAsyncFunction, why we cannot access the state through
runtime context like other operators?

Best,
Shimin Yang

Re: State access in RichAsyncFunction

Posted by shimin yang <ys...@gmail.com>.
Thanks, Till.

Best
Shimin

Till Rohrmann <tr...@apache.org> 于2018年10月19日周五 下午4:22写道:

> The problem is that `RichAsyncFunction` is allowed to trigger an
> asynchronous operation which can keep a reference to the `RuntimeContext`.
> However, it is not guaranteed when this operation is actually executed. Due
> to this, the underlying key could have changed, thus, accessing state which
> can belong to another key. One would have to reset the corresponding key
> before accessing the state. But this is not yet happening.
>
> Cheers,
> Till
>
> On Fri, Oct 19, 2018 at 8:37 AM shimin yang <ys...@gmail.com> wrote:
>
> > Hi all,
> >
> > Regarding to the RichAsyncFunction, why we cannot access the state
> through
> > runtime context like other operators?
> >
> > Best,
> > Shimin Yang
> >
>

Re: State access in RichAsyncFunction

Posted by Till Rohrmann <tr...@apache.org>.
The problem is that `RichAsyncFunction` is allowed to trigger an
asynchronous operation which can keep a reference to the `RuntimeContext`.
However, it is not guaranteed when this operation is actually executed. Due
to this, the underlying key could have changed, thus, accessing state which
can belong to another key. One would have to reset the corresponding key
before accessing the state. But this is not yet happening.

Cheers,
Till

On Fri, Oct 19, 2018 at 8:37 AM shimin yang <ys...@gmail.com> wrote:

> Hi all,
>
> Regarding to the RichAsyncFunction, why we cannot access the state through
> runtime context like other operators?
>
> Best,
> Shimin Yang
>