You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Jing Ge (Jira)" <ji...@apache.org> on 2022/03/11 08:20:00 UTC

[jira] [Updated] (FLINK-25702) Use the configure feature provided by the kafka Serializer/Deserializer.

     [ https://issues.apache.org/jira/browse/FLINK-25702?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jing Ge updated FLINK-25702:
----------------------------
    Description: 
It is hard to understand the reason of using {{Configurable}} for KafkaRecordDeserializationSchema, since Deserializer already has the similar method for configuring.

It assumes that users might have defined a deserializerA as a subclass of both Configurable and Deserializer, where (Configurable){{{}deserializerA::configure(Map<String, ?>){}}} could have user-defined configuration logic. Since this subclass could be defined by user outside the Flink project, we want to continue to support this user-defined deserializer for backward compatibility. 

This backward compatibility has been considered. This idea is to reduce the type control of the input parameter DeserializationSchema a little bit from {{Configurable & Deserializer<V>}} to {{{}Deserializer<V>{}}}. The wrapper will check internally and call {{org.apache.kafka.common.Configurable.configure}} if the schema implements {{{}Configurable{}}}. In this way, old cases due to the backward compatibility will be supported implicitly without confusing users who use {{Deserializer.configure}}

  was:
It is hard to understand the reason of using {{Configurable}} for KafkaRecordDeserializationSchema, since Deserializer already has the similar method for configuring.

It assumes that users might have defined a deserializerA as a subclass of both Configurable and Deserializer, where (Configurable){{{}deserializerA::configure(Map<String, ?>){}}} could have user-defined configuration logic. Since this subclass could be defined by user outside the Flink project, we want to continue to support this user-defined deserializer for backward compatibility. 

This backward compatibility has been considered. This idea is to just reduce the type control of the input parameter DeserializationSchema a little bit from {{Configurable & Deserializer<V>}} to {{{}Deserializer<V>{}}}. The wrapper will check internally and call {{org.apache.kafka.common.Configurable.configure}} if the schema implements {{{}Configurable{}}}. In this way, old cases due to the backward compatibility will be supported implicitly without confusing users who use {{Deserializer.configure}}


> Use the configure feature provided by the kafka Serializer/Deserializer.
> ------------------------------------------------------------------------
>
>                 Key: FLINK-25702
>                 URL: https://issues.apache.org/jira/browse/FLINK-25702
>             Project: Flink
>          Issue Type: Improvement
>    Affects Versions: 1.14.3
>            Reporter: Jing Ge
>            Assignee: Jing Ge
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.15.0
>
>
> It is hard to understand the reason of using {{Configurable}} for KafkaRecordDeserializationSchema, since Deserializer already has the similar method for configuring.
> It assumes that users might have defined a deserializerA as a subclass of both Configurable and Deserializer, where (Configurable){{{}deserializerA::configure(Map<String, ?>){}}} could have user-defined configuration logic. Since this subclass could be defined by user outside the Flink project, we want to continue to support this user-defined deserializer for backward compatibility. 
> This backward compatibility has been considered. This idea is to reduce the type control of the input parameter DeserializationSchema a little bit from {{Configurable & Deserializer<V>}} to {{{}Deserializer<V>{}}}. The wrapper will check internally and call {{org.apache.kafka.common.Configurable.configure}} if the schema implements {{{}Configurable{}}}. In this way, old cases due to the backward compatibility will be supported implicitly without confusing users who use {{Deserializer.configure}}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)