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

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

Thanks,

If I am using registerTypeWithKryoSerializer function, and I want to force that 
only custom Kryo serializer is allowed, similar to disableGenericTypes config, 
how should I approach that? Should I wait for the DataSet\DataStream to be 
combined?  If so, what is the ETA? Or should I implement built-in Flink 
serializer instead? Thanks


was (Author: yaronshani):
Thanks,

If I am using registerTypeWithKryoSerializer function, and I want to force that 
only custom Kryo serializer is allowed, similar to disableGenericTypes config, 
how should I approach that? Should I wait from the DataSet\DataStream to be 
combined?  If so, what is the ETA? Or should I implement built-in Flink 
serializer instead? Thanks

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

Reply via email to