Search code examples
apache-flinkflink-streaming

Flink: stateful access in RichAsyncFunction?


The Flink documentation for RichAsyncFunction states:

State related apis in RuntimeContext are not supported yet because the key may get changed while accessing states in the working thread.

What exactly does this mean? Which calls are permitted and which are not? What will happen if calls are made to an unsupported method?

The documentation for RuntimeContext is here.


Solution

  • The RichAsyncFunction provides its own subclass of RuntimeContext, which throws UnsupportedOperationException when trying to access any state.