You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Timo Walther (Jira)" <ji...@apache.org> on 2020/05/14 07:55:00 UTC

[jira] [Commented] (FLINK-17584) disableAutoTypeRegistration option does not work with Streaming API, only with Batch

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

Timo Walther commented on FLINK-17584:
--------------------------------------

[~yaronshani] is this really a problem in DataStream API? As far as I can see, we are not using auto types there. It controls `org.apache.flink.api.java.typeutils.runtime.kryo.Serializers#recursivelyRegisterType()` which is only used in DataSet API.

> disableAutoTypeRegistration option does not work with Streaming API, only with Batch
> ------------------------------------------------------------------------------------
>
>                 Key: FLINK-17584
>                 URL: https://issues.apache.org/jira/browse/FLINK-17584
>             Project: Flink
>          Issue Type: Bug
>          Components: API / DataStream
>    Affects Versions: 1.10.0
>            Reporter: Yaron Shani
>            Priority: Minor
>
> Hey,
> There is a feature called disableAutoTypeRegistration which is, from my understanding, should disable the auto-loading classes into Kryo. It seems to work on the Batch API, but I don't see any reference into the DataStream code, and it does not work there. Is it by design? If so, I think its better if it would state it clearly. If not, can I suggest a fix? Something like this:
>  
> {code:java}
> @Override
> @PublicEvolving
> public TypeSerializer<T> createSerializer(ExecutionConfig config) {
>    if (config.hasGenericTypesDisabled()) {
>       throw new UnsupportedOperationException(
>          "Generic types have been disabled in the ExecutionConfig and type " + this.typeClass.getName() +
>          " is treated as a generic type.");
>    }
>    if(config.isAutoTypeRegistrationDisabled()) {
>       if(!config.getRegisteredKryoTypes().contains(this.typeClass)) {
>          throw new UnsupportedOperationException(
>             "Auto type registration (disableAutoTypeRegistration) have been enabled in the ExecutionConfig and type " + this.typeClass.getName() +
>                " is treated as a auto type.");
>       }
>    }
>    return new KryoSerializer<T>(this.typeClass, config);
> }
> {code}
>  
>  



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