flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Seth Wiesman <sjwies...@gmail.com>
Subject Re: Creating singleton objects per task manager
Date Mon, 06 Apr 2020 14:21:23 GMT
Hi Salva,

One TaskManager == One JVM. There is nothing Flink specific here, you can
just create a singleton how you would in any other JVM application. But be
careful, if your singleton does any sort of locking/coordination it will
quickly become the bottleneck in your application. I would strongly
encourage you to create one instance of your object per ProcessFunction,
inside of open. That would be one instance per slot which is not equal to
the parallelism of your operator. This would not create an object per key
if that is your concern.

On Mon, Apr 6, 2020 at 5:26 AM Salva Alcántara <salcantaraphd@gmail.com>

> I need to create a singleton (manager) object to be used within all the
> parallel instances of my UDF operator (a `ProcessFunction`). What is the
> proper way of creating such a singleton object per task manager?
> --
> Sent from:
> http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/

View raw message