flink-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Alexandrov <alexander.s.alexand...@gmail.com>
Subject Allow TypeInfofactory regisration via ExecutionConfig
Date Sat, 08 Oct 2016 14:00:56 GMT
I wanted to open this directly as a JIRA to follow-up on FLINK-3042,
however my account (aalexandrov) does not seem to have the necessary
privileges, so I will post this to the dev list instead.

The current approach for registration of custom `TypeInformation`
implementations which relies exclusively on annotations. Consequently, it
will be very tedious to create a custom `TypeInformation` for types that
are pulled and used within a project from an external library.

For example, if  I have a project structure such as

```
my-project      // uses FancyContainer<A>
 `- flink-core
 `- ext-library // defines FancyContainer<A>
```

I will not be able to modify `FancyContainer.java`.

A workaround that might work (I have not tested it yet) is to use
`javassist` to attach the annotation prior to job assembly, but IMHO a much
clearer solution would be to extend the `ExecutionEnvironment` with
something like

```java
env.getConfig().registerTypeInfoFactory(Class<?> type, Class<? extends
TypeInfofactory<?>> factory)
```

Regards,
Alexander

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message