You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Barry Higgins <ba...@gmail.com> on 2022/01/20 17:22:51 UTC

Statefun and the DataStream API

Hi,

We have been looking at using stateful functions to deploy a remote
python model as a stateful and interacting with it from Flink via
Kafka.

Everything has worked well until we ran into some in-house deployment
issues around the various environments.

This coupled with the use case (where we may be happy to put the state
load on the calling Flink app) means that we are looking again at
calling our model via the DataSteam API.

The documentation at
https://nightlies.apache.org/flink/flink-statefun-docs-release-3.1/docs/sdk/flink-datastream/
does link to an example but that is a dead link and that I’m guessing
would point back to:
https://github.com/apache/flink-statefun/blob/release-2.2/statefun-examples/statefun-flink-datastream-example/src/main/java/org/apache/flink/statefun/examples/datastream/Example.java

I am struggling to follow the creation of a valid
StatefulFunctionDataStreamBuilder in relation to a remote function
particularly this line:

.withFunctionProvider(GREET, unused -> new MyFunction())

where the calling code seems to have access to the remote function.

Would anyone be able to give me a steer please?

Thanks,

Barry