Hi,
I would like to ask Flink Pojo Serialziation described in [1]
I have a case where my custom event source produces Events described by
Pojo:
public class DataPoint
{
public long timestamp;
public double value;
public BadPojo badPojo = new BadPojo();
public DataPoint() {}
}
Where BadPojo class is something like this:
public class BadPojo {
private final String fieldA = "X";
}
So this is case where Flink, using default configuration should fall back to
Kryo, and it does.
In logs I can see entries:
org.apache.flink.api.java.typeutils.TypeExtractor - class
org.home.streaming.events.BadPojo does not contain a getter for field fieldA
So this is an expected result.
However when I change DataPoint class to use:
public Map<String, BadPojo> badPojo = new HashMap<>();
instead direct BadPojo field no longer see logs complaining about BadPojo
class.
In this case DataPoint class looks like this:
public class DataPoint
{
public long timestamp;
public double value;
public Map<String, BadPojo> badPojo = new HashMap<>();
public DataPoint() {}
}
My questions:
1. What actually happen here?
2. Which setrializator is used by Flink?
3. How Maps should be handled in Pojo definition to get best Serialization
performance (assuming that I do need access that map).
Thanks,
Krzysztof
[1]
https://ci.apache.org/projects/flink/flink-docs-stable/dev/types_serialization.html#pojos
--
Sent from: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/