[SPARK-20059][YARN] Use the correct classloader for HBaseCredentialProvider#17388
[SPARK-20059][YARN] Use the correct classloader for HBaseCredentialProvider#17388jerryshao wants to merge 3 commits intoapache:masterfrom
Conversation
Change-Id: I04d6ffcdca58277e60d3dd0c456f4c6a2936b320
|
Test build #75052 has finished for PR 17388 at commit
|
|
@vanzin @tgravescs @mridulm do you think it necessary to add additional jars and main jar into classloader for yarn cluster mode? In my case I run Spark with HBase in secure cluster, so I need to specify hbase jars with This also applies to the customized credential provider, if we write a customized one and package into main jar, then it will be failed to load by ServiceLoader because this main jar is not presented in client's classloader. Though this could be fixed by expanding launch classpath (like SPARK_CLASSPATH) as a workaround, I think a good solution is to add to child's classpath. What do you think, is there any concern to put these jars into child's classpath in yarn cluster mode? Thanks a lot. |
Change-Id: Ib5e831e46aee395833af5ac4829f7da0a5e6282c
|
Test build #75078 has finished for PR 17388 at commit
|
|
I think that's ok; the jars are still added to a separate class loader, so they won't affect the Spark classes. The only caveat is that |
|
Thanks @vanzin for your comments. Yes, remote jars will also not be added to client's classpath currently. Any further comments? |
| // In client mode, launch the application main class directly | ||
| // In addition, add the main application jar and any added jars (if any) to the classpath | ||
| if (deployMode == CLIENT) { | ||
| // Also add the main application jar and any added jars to classpath in case yarn#client |
There was a problem hiding this comment.
s/yarn#client/the YARN client/
Otherwise it seems you're talking about yarn-client mode.
There was a problem hiding this comment.
Thanks @vanzin , just updated the comment.
|
Minor comment on a comment, otherwise LGTM. |
Change-Id: I9c694b1789a3216ac49f55b851090d0170fd5aec
|
Test build #75334 has finished for PR 17388 at commit
|
|
Merging to master / 2.1. |
…ovider ## What changes were proposed in this pull request? Currently we use system classloader to find HBase jars, if it is specified by `--jars`, then it will be failed with ClassNotFound issue. So here changing to use child classloader. Also putting added jars and main jar into classpath of submitted application in yarn cluster mode, otherwise HBase jars specified with `--jars` will never be honored in cluster mode, and fetching tokens in client side will always be failed. ## How was this patch tested? Unit test and local verification. Author: jerryshao <sshao@hortonworks.com> Closes #17388 from jerryshao/SPARK-20059. (cherry picked from commit c622a87) Signed-off-by: Marcelo Vanzin <vanzin@cloudera.com>
What changes were proposed in this pull request?
Currently we use system classloader to find HBase jars, if it is specified by
--jars, then it will be failed with ClassNotFound issue. So here changing to use child classloader.Also putting added jars and main jar into classpath of submitted application in yarn cluster mode, otherwise HBase jars specified with
--jarswill never be honored in cluster mode, and fetching tokens in client side will always be failed.How was this patch tested?
Unit test and local verification.