Hi,

I was looking into a problem that requires a configurable type
serializer for communication with a schema registry. The service
endpoint can change, so I would not want to make it part of the
serializer snapshot but rather resolve it at graph construction time
(similar to how a Kafka bootstrap URL or JDBC connection URL would not
be embedded into a checkpoint).

TypeSerializer is instantiated via either TypeInformation or
TypeSerializerSnapshot. While TypeInformation provides access to
ExecutionConfig and therefore ability to access parameters from
GlobalJobParameters that could be provided through the entry point,
restoreSerializer requires the serializer to be constructed from the
snapshot state alone.

Ideally there would be a dependency injection mechanism for user code.
Discussion in [1] indicated there isn't a direct solution. Has anyone
come across a similar use case and found a way to work around this
limitation? It might be possible to work with a configuration
singleton that initializes from a file in a well known location, but
that depends on the deployment environment and doesn't play nice with
testing.

Thanks,
Thomas

[1] https://lists.apache.org/thread/6qbr4b391dcfwxhcvdl066rpv86gpm5o

Reply via email to