[ https://issues.apache.org/jira/browse/FLINK-17584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17107882#comment-17107882 ]
Guowei Ma commented on FLINK-17584: ----------------------------------- Thanks for opening this issue. 1. I think the autoTypeRegistrationEnabled is only used for the Dataset to register the type of output of all operators to Kryo. However, DataStream would use the TypeExtractor to create their output/state’s serializer and Kryo just a fallback. So I think it is reasonable that DataStream API does not handle autoTypeRegistrationEnabled. 2. >>>>>[https://github.com/apache/flink/blob/master/flink-core/src/main/java/org/apache/flink/api/java/typeutils/GenericTypeInfo.java#L90] This would not register all types. The DataStream's type extract stack would not call the `registerType` at all. 3. I think we maybe we could do some improvements for the comments of autoTypeRegistrationEnabled. But when Flink replace DataSet with DataStream these issues would be gone. > 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)