New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FLINK-924] Add automatic dependency retrieval for JarFileCreator #35
Conversation
Wow, this looks like good stuff! But: It has not a single test that covers the building, verifying that wanted dependencies ade fully added (includings things like inner classes, static references, all that) and that unwanted ones are not added. I think we can only merge this once it has some tests. |
Cool, the tests are a good start! I think it would be very good to add the following cases, that are tricky for the dependency visitor:
|
Also: What is the impact of Java 8 lambdas on this. Would they work, i.e. would the dependency visitor find their dependencies? |
Tests looks interesting! Java 8 lambdas is not tested. I'll test it in the next update. |
Hey @StephanEwen , i'm a bit confused about your cases. Could you also post the correct dependencies here. |
@qmlmoon Here are a few more details of what I think would be good to change / add as tests: ( updated, I forgot the core point ;-) )
public class ThresholdFilter {
public static boolean filter(Long value) {
return value > 10;
}
} ...
FilerFunction<Long> filter = (v) -> ThresholdFilter.filter(v);
DataSet<Long> = someData.filter(filter);
... as well as ...
DataSet<Long> = someData.filter( (v) -> ThresholdFilter.filter(v) );
... and ...
class UtilFunctions {
public static FilterFunction<Long> getThresholdFilter(long threshold) {
return (v) -> ThresholdFilter.filter(v);
}
}
public static void main(String[] args) {
...
DataSet<Long> = someData.filter(UtilFunctions.getThresholdFilter(10));
...
}
...
|
I tested it with Java 8 lambda today. ASM 4.x doesn't support Java 8. ASM 5 works as expected. I also checked other module that contains ASM dependency. It turns out that only |
ASM 4.x was used in the ClosureCleaner that was removed in the rewrite of the Scala API. I have an open pull request that re-adds the ClosureCleaner: #156. I will see whether this also works with ASM 5.x, then we can bump the version to this. |
Ok, seems to also work with ASM 5, so you can change the version there. |
I think we need to remove the versions in both places and add a depedencyManagement entry in the root pom.xml file for this to work safely. |
Hi @qmlmoon, |
Conflicts: flink-runtime/pom.xml flink-runtime/src/main/java/org/apache/flink/runtime/util/JarFileCreator.java
I rebased the PR on the current master and removed the annoying merge commits. |
Thanks for working with this on me. Very nice contribution. 😄 |
Very good! Is there a way we can integrate this deeper with the remote environment? Something like |
… lambdas This closes apache#35
… lambdas This closes apache#35
… lambdas This closes apache#35
…273) (apache#35) * [FLINK-30083] Bump maven-shade-plugin version * [FLINK-24273][kubernetes] Relocate io.fabric8 dependency. * change shade version bump * undo shade plugin changes Co-authored-by: David Moravek <dmvk@apache.org>
This improvement sets the package of user code as default package and let user to specify additional packages to be scanned.
Tested with inner class, anonymous class and additional package.
The current API could be used like: