-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-5052] Add common/base classes to fix guava methods signatures. #3874
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
Conversation
|
Can one of the admins verify this patch? |
|
You're right that I think this is too broad. I think I misspoke earlier. Isn't the theory here that you can bring a later version if Optional with you in your app? Spark barely uses its API. If your copy of Optional hides the one in Spark, which is only there to keep the signature the same, is that OK? |
|
I tried that before using spark.files.userClassPathFirst, but it resulted in a |
|
The problem seems to be fixed when using Thanks |
|
Reopening, the problem is still there when running on the standalone cluster. |
|
Can one of the admins verify this patch? |
|
@vanzin, any input here? Running with the patched code seems to solve the problem. Running on 1.2.0 standalone cluster generates the following errors: a) |
|
This one always confuses me, but here's what I think I know: The compiled Apps that uses the API method that uses You say you tried it and got |
|
Damn, exposing That being said, I think only |
|
I tried adding Function before, but it had some runtime dependencies. On Mon, Jan 5, 2015, 10:27 AM Marcelo Vanzin [email protected]
|
|
What runtime dependencies does Also, because of the |
|
The only risk here is that this increases surface area for Guava version conflict, which was the whole point of the shading. Elmer has some analysis of what happens when you do this in the JIRA: https://issues.apache.org/jira/browse/SPARK-5052?focusedCommentId=14262740&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14262740 I'm still not sure why the heck the |
|
In fact what happens is the following: If you embed guava on your jar you still get It is when you specify |
|
Yeah, that's why I'd like to restrict the exclusions as much as possible. Exposing more Guava types makes it harder and harder for people to use a different Guava version in their apps. I'm still trying to wrap my head around the |
|
Let me try just adding |
596ddba to
aa5d8e0
Compare
|
Thanks, that worked, I updated the PR to reflect those changes. And here is a list of the actual classes that get included into the jar: |
|
Latest version LGTM. Thanks! |
|
Although further creep of the unshading-of-the-shading feels risky, it seems to resolve a problem, and is in principle OK on the same grounds that unshading |
|
Thanks all, anything else left to be done here? |
|
Not from your side, you just need a committer to notice this PR. :-) @pwendell ? |
|
Ping? |
|
Jenkins test this please. |
|
Jenkins, test this please. |
|
LGTM although it's now been rolled into #3658 (@vanzin - maybe we can merge this one first just so we give credit correctly to @elmer-garduno). |
|
Test build #26121 has started for PR 3874 at commit
|
|
Yeah, no problem. I just didn't want to cause a regression later when my changes go in. |
|
Test build #26121 has finished for PR 3874 at commit
|
|
Test FAILed. |
|
Jenkins, retest this please. |
|
Test build #26126 has started for PR 3874 at commit
|
|
Test build #26126 has finished for PR 3874 at commit
|
|
Test PASSed. |
|
Thanks for merging! |
The current way of shading Guava is a little problematic. Code that depends on "spark-core" does not see the transitive dependency, yet classes in "spark-core" actually depend on Guava. So it's a little tricky to run unit tests that use spark-core classes, since you need a compatible version of Guava in your dependencies when running the tests. This can become a little tricky, and is kind of a bad user experience. This change modifies the way Guava is shaded so that it's applied uniformly across the Spark build. This means Guava is shaded inside spark-core itself, so that the dependency issues above are solved. Aside from that, all Spark sub-modules have their Guava references relocated, so that they refer to the relocated classes now packaged inside spark-core. Before, this was only done by the time the assembly was built, so projects that did not end up inside the assembly (such as streaming backends) could still reference the original location of Guava classes. The Guava classes are added to the "first" artifact Spark generates (network-common), so that all downstream modules have the needed classes available. Since "network-common" is a dependency of spark-core, all Spark apps should get the relocated classes automatically. Author: Marcelo Vanzin <[email protected]> Closes #3658 from vanzin/SPARK-4809 and squashes the following commits: 3c93e42 [Marcelo Vanzin] Shade Guava in the network-common artifact. 5d69ec9 [Marcelo Vanzin] Merge branch 'master' into SPARK-4809 b3104fc [Marcelo Vanzin] Add comment. 941848f [Marcelo Vanzin] Merge branch 'master' into SPARK-4809 f78c48a [Marcelo Vanzin] Merge branch 'master' into SPARK-4809 8053dd4 [Marcelo Vanzin] Merge branch 'master' into SPARK-4809 107d7da [Marcelo Vanzin] Add fix for SPARK-5052 (PR #3874). 40b8723 [Marcelo Vanzin] Merge branch 'master' into SPARK-4809 4a4ed42 [Marcelo Vanzin] [SPARK-4809] Rework Guava library shading.
Fixes problems with incorrect method signatures related to shaded classes. For discussion see the jira issue.