Fokko opened a new pull request #7979: Fd patch kafka topic partition
URL: https://github.com/apache/flink/pull/7979
 
 
   ## What is the purpose of the change
   
   KafkaTopicPartition is not a POJO, and therefore it cannot be serialized 
efficiently. This is using the KafkaDeserializationSchema.
   
   When enforcing POJO's:
   ```
   java.lang.UnsupportedOperationException: Generic types have been disabled in 
the ExecutionConfig and type 
org.apache.flink.streaming.connectors.kafka.internals.KafkaTopicPartition 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.TupleTypeInfo.createSerializer(TupleTypeInfo.java:107)
        at 
org.apache.flink.api.java.typeutils.TupleTypeInfo.createSerializer(TupleTypeInfo.java:52)
        at 
org.apache.flink.api.java.typeutils.ListTypeInfo.createSerializer(ListTypeInfo.java:102)
        at 
org.apache.flink.api.common.state.StateDescriptor.initializeSerializerUnlessSet(StateDescriptor.java:288)
        at 
org.apache.flink.runtime.state.DefaultOperatorStateBackend.getListState(DefaultOperatorStateBackend.java:289)
        at 
org.apache.flink.runtime.state.DefaultOperatorStateBackend.getUnionListState(DefaultOperatorStateBackend.java:219)
        at 
org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumerBase.initializeState(FlinkKafkaConsumerBase.java:856)
        at 
org.apache.flink.streaming.util.functions.StreamingFunctionUtils.tryRestoreFunction(StreamingFunctionUtils.java:178)
        at 
org.apache.flink.streaming.util.functions.StreamingFunctionUtils.restoreFunctionState(StreamingFunctionUtils.java:160)
        at 
org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator.initializeState(AbstractUdfStreamOperator.java:96)
        at 
org.apache.flink.streaming.api.operators.AbstractStreamOperator.initializeState(AbstractStreamOperator.java:278)
        at 
org.apache.flink.streaming.runtime.tasks.StreamTask.initializeState(StreamTask.java:738)
        at 
org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:289)
        at org.apache.flink.runtime.taskmanager.Task.run(Task.java:711)
        at java.lang.Thread.run(Thread.java:748)
   ```
   
   And in the logs:
   ```
   2019-03-13 16:41:28,217 INFO  
org.apache.flink.api.java.typeutils.TypeExtractor             - class 
org.apache.flink.streaming.connectors.kafka.internals.KafkaTopicPartition does 
not contain a setter for field topic
   2019-03-13 16:41:28,221 INFO  
org.apache.flink.api.java.typeutils.TypeExtractor             - Class class 
org.apache.flink.streaming.connectors.kafka.internals.KafkaTopicPartition 
cannot be used as a POJO type because not all fields are valid POJO fields, and 
must be processed as GenericType. Please read the Flink documentation on "Data 
Types & Serialization" for details of the effect on performance.
   ```
   
   ## Brief change log
   
   Add:
   - An empty default constructor
   - Make the fields public
   
   ## Verifying this change
   
   Reran the job, and the log messages above disappeared.
   
   Related to: 
https://stackoverflow.com/questions/54008805/in-logs-i-see-kafkatopicpartition-cannot-be-used-as-a-pojo-what-that-it-means
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: no
     - The serializers: yes
     - The runtime per-record code paths (performance sensitive): no
     - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Yarn/Mesos, ZooKeeper: no
     - The S3 file system connector: no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? no
     - If yes, how is the feature documented? JavaDocs
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to