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

[jira] [Comment Edited] (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=17107061#comment-17107061 ] 

Yaron Shani edited comment on FLINK-17584 at 5/14/20, 8:25 AM:
---------------------------------------------------------------

[~twalthr] Hey, thanks for the response. When you come to think about it, we might not be calling recursivelyRegisterType function, but we are auto registering all the types to Kryo in the DataStream API using this line

[https://github.com/apache/flink/blob/master/flink-core/src/main/java/org/apache/flink/api/java/typeutils/GenericTypeInfo.java#L90]

Because of that, I think we should either make a PR with the suggested fix (I can do it if needed), or we should explicitly say in the documentation that this configuration is only applied to Batch DataSet API and not stream (even though it can be configured in streams, it has no effect).

 

Also, I think my suggested fix location might not be 100% logical, I might need to move it to org.apache.flink.api.java.typeutils.runtime.kryo.KryoSerializer class to make more sense.

 

 

 


was (Author: yaronshani):
[~twalthr] Hey, thanks for the response. When you come to think about it, we might not be calling recursivelyRegisterType function, but we are auto registering all the types to Kryo in the DataStream API using this line

[https://github.com/apache/flink/blob/master/flink-core/src/main/java/org/apache/flink/api/java/typeutils/GenericTypeInfo.java#L90]

Because of that, I think we should either make a PR with the suggested fix (I can do it if needed), or we should explicitly say in the documentation that this configuration is only applied to Batch DataSet API and not stream (even though it can be configured in streams, it has no effect).

 

 

 

> 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)