[
https://issues.apache.org/jira/browse/FLINK-4783?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15562288#comment-15562288
]
Alexander Alexandrov commented on FLINK-4783:
---------------------------------------------
Alright, I guess keeping {{TypeExtractor#registerFactory}} static makes sense,
but it still does not solve the problem with types from an external library.
Maybe delegating through {{ExecutionConfig}} as suggested by [~till.rohrmann]
is a cleaner way that will provide means to throw an exception if the
registration at a wrong position in the code.
This will also be on par with the similar method which already exists for
registering Kryo serializers.
{code:scala}
env.getConfig().registerTypeInfoFactory(Class<?> type, Class<? extends
TypeInfofactory<?>> factory)
{code:scala}
> Allow to register TypeInfoFactories manually
> --------------------------------------------
>
> Key: FLINK-4783
> URL: https://issues.apache.org/jira/browse/FLINK-4783
> Project: Flink
> Issue Type: Improvement
> Components: Type Serialization System
> Affects Versions: 1.2.0
> Reporter: Till Rohrmann
> Priority: Minor
> Fix For: 1.2.0
>
>
> The newly introduced {{TypeInfoFactories}} (FLINK-3042 and FLINK-3060) allow
> to create {{TypeInformations}} for types which are annotated with
> {{TypeInfo}}. This is useful if the user has control over the type for which
> he wants to generate the {{TypeInformation}}.
> However, annotating a type is not always possible if the type comes from an
> external library. In this case, it would be good to be able to directly
> register a {{TypeInfoFactory}} without having to annotate the type.
> The {{TypeExtractor#registerFactory}} already has such a method. However, it
> is declared private.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)