[ 
https://issues.apache.org/jira/browse/FLINK-17306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17240808#comment-17240808
 ] 

Dawid Wysakowicz commented on FLINK-17306:
------------------------------------------

In the end we decided to add only the {{open}} method. Some context for that 
decision for a future reference:

When adding close() method to both DeserializationSchema and 
SerializationSchema with a default implementation, it breaks source 
compatibility if a user's class implements both interfaces at the same time. 
The problem is that java does not know which default implementation to use from 
those two interfaces as the close() signature is the same in both. In flink 
code base we have three of such implementations: SimpleStringSchema 
TypeInformationSerializationSchema and one in tests  It is not a problem for 
open as we have a paremeter there that differentiates the two methods.

We decided to skip the {{close}} for now until we have a first use case for it. 
We do not need to close the schema registry client because it communicates over 
REST. Moreover no other schema needs a close for now. For the Table API we also 
need only the open for generating the code of the serializer.

> Add open method to DeserializationSchema
> ----------------------------------------
>
>                 Key: FLINK-17306
>                 URL: https://issues.apache.org/jira/browse/FLINK-17306
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Connectors / Common
>            Reporter: Dawid Wysakowicz
>            Assignee: Dawid Wysakowicz
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.11.0
>
>
> Additionally add support for it in connectors:
> * Kafka
> * PubSub
> * RabbitMQ
> * Kinesis



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to