flink-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephan Ewen <se...@apache.org>
Subject Re: Java type erasure and object reuse
Date Fri, 18 Sep 2015 08:52:00 GMT
Good problem...

We were thinking for a while to make the input and output type serializers
available from the RuntimeContext.
That way you could call "T copy = serializer.copy(inValue)".

The "copy()" method on the copyable value is actually a good addition

On Thu, Sep 17, 2015 at 10:31 PM, Greg Hogan <code@greghogan.com> wrote:

> What is best practice for handling Java type erasure in user defined
> functions? Is there a means by which the TypeInformation can be accessed
> from a RichFunction? My temporary solution was to add a "T copy()" method
> to the CopyableValue interface.
> A common use case is a GroupReduceFunction that needs to collect objects.
> With object reuse we need to make a copy and with type erasure we cannot
> call new.
> Greg Hogan

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message