Details
-
Improvement
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
1.2.1, 1.3.0
-
None
Description
Problem
Currently, Flink shades dependencies like ASM and Guava into all jars of projects that reference it and relocate the classes.
There are some drawbacks to that approach, let's discuss them at the example of ASM:
- The ASM classes are for example in flink-core, flink-java, flink-scala, flink-runtime, etc.
- Users that reference these dependencies have the classes multiple times in the classpath. That is unclean (works, through, because the classes are identical). The same happens when building the final dist. jar.
- Some of these dependencies require to include license files in the shaded jar. It is hard to impossible to build a good automatic solution for that, partly due to Maven's very poor cross-project path support
- Scala does not support shading really well. Scala classes have references to classes in more places than just the class names (apparently for Scala reflect support). Referencing a Scala project with shaded ASM still requires to add a reference to unshaded ASM (at least as a compile dependency).
Proposal
I propose that we build and deploy a asm-flink-shaded version of ASM and directly program against the relocated namespaces. Since we never use classes that we relocate in public interfaces, Flink users will never see the relocated class names. Internally, it does not hurt to use them.
- Proper maven dependency management, no hidden (shaded) dependencies
- one copy of each dependency
- proper Scala interoperability
- no clumsy license management (license is in the deployed asm-flink-shaded)
Attachments
Issue Links
- is depended upon by
-
FLINK-6692 The flink-dist jar contains unshaded netty jar
- Resolved
1.
|
Add README to "flink-shaded.git" repository | Closed | Chesnay Schepler | |
2.
|
Add shaded guava dependency | Closed | Chesnay Schepler | |
3.
|
Replace guava dependencies | Closed | Chesnay Schepler | |
4.
|
Add shaded netty dependency | Closed | Chesnay Schepler | |
5.
|
Replace netty dependencies | Closed | Chesnay Schepler | |
6.
|
Add shaded asm dependency | Closed | Chesnay Schepler | |
7.
|
Replace asm dependencies | Closed | Chesnay Schepler | |
8.
|
Add new import block for shaded dependencies | Closed | Chesnay Schepler | |
9.
|
Create flink-shaded-jackson | Closed | Chesnay Schepler | |
10.
|
Replace all uses of jackson with flink-shaded-jackson | Closed | Chesnay Schepler | |
11.
|
Shade jackson dependency in flink-avro | Closed | Chesnay Schepler | |
12.
|
Relocate ZooKeeper | Closed | Chesnay Schepler | |
13.
|
Relocate Curator | Closed | Chesnay Schepler | |
14.
|
Shade jackson (org.codehouse.jackson) in flink-shaded-hadoop2 | Closed | Stephan Ewen |