title: Flink serialization of java.util.List and java.util.Map
body: <p>My Flink pipeline currently uses an Pojo that contains some Lists and Maps (of Strings), along the lines of</p>
  
  <pre><code>public class MyPojo {
      private List&lt;String&gt; myList = new ArrayList&lt;&gt;();
      private OtherPojo otherPojo = new OtherPojo();
  
      // getters + setters...
  }
  
  public class OtherPojo {
      private Map&lt;String, String&gt; myMap = new HashMap&lt;&gt;();
  
      // getters + setters...
  }
  
  </code></pre>
  
  <p>For performance reasons, I want to get around Kryo serialization, so I disabled the generic fallback with <code>env.getConfig().disableGenericTypes();</code> as described in the <a href="https://ci.apache.org/projects/flink/flink-docs-stable/dev/types_serialization.html" rel="nofollow noreferrer">Flink documentation</a>.</p>
  
  <p>Now, Flink complains about the lists:</p>
  
  <pre><code>Exception in thread "main" java.lang.UnsupportedOperationException: Generic types have been disabled in the ExecutionConfig and type java.util.List is treated as a generic type.
      at org.apache.flink.api.java.typeutils.GenericTypeInfo.createSerializer(GenericTypeInfo.java:86)
      at org.apache.flink.api.java.typeutils.PojoTypeInfo.createPojoSerializer(PojoTypeInfo.java:319)
      at org.apache.flink.api.java.typeutils.PojoTypeInfo.createSerializer(PojoTypeInfo.java:311)
      at org.apache.flink.streaming.api.graph.StreamGraph.addOperator(StreamGraph.java:258)
      at org.apache.flink.streaming.api.graph.StreamGraphGenerator.transformOneInputTransform(StreamGraphGenerator.java:649)
      at org.apache.flink.streaming.api.graph.StreamGraphGenerator.transform(StreamGraphGenerator.java:250)
      at org.apache.flink.streaming.api.graph.StreamGraphGenerator.generate(StreamGraphGenerator.java:209)
      at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.getStreamGraph(StreamExecutionEnvironment.java:1540)
      at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.execute(StreamExecutionEnvironment.java:1507)
      ...
  </code></pre>
  
  <p>What is the preferred way of serializing such simple lists and maps in Flink?. Internally, these are currently <code>ArrayList</code> and <code>HashMap</code>, but other implementations would also be fine. There seems to be a class <code>org.apache.flink.api.common.typeutils.base.ListSerializer</code> in Flink, but I do not know how to use it.</p>