Github user brkyvz commented on a diff in the pull request:
https://github.com/apache/spark/pull/15666#discussion_r104527000
--- Diff: core/src/main/scala/org/apache/spark/SparkContext.scala ---
@@ -1800,17 +1800,39 @@ class SparkContext(config: SparkConf) extends
Logging {
* an HTTP, HTTPS or FTP URI, or local:/path for a file on every worker
node.
*/
def addJar(path: String) {
+ addJar(path, false)
+ }
+
+ /**
+ * Adds a JAR dependency for all tasks to be executed on this
`SparkContext` in the future.
+ * @param path can be either a local file, a file in HDFS (or other
Hadoop-supported filesystems),
+ * an HTTP, HTTPS or FTP URI, or local:/path for a file on every worker
node.
+ * @param addToCurrentClassLoader if true will add the jar to the
current threads' classloader.
+ * In general adding to the current threads' class loader will impact
all other application
+ * threads unless they have explicitly changed their class loader.
+ */
+ @DeveloperApi
+ def addJar(path: String, addToCurrentClassLoader: Boolean) {
if (path == null) {
logWarning("null specified as parameter to addJar")
} else {
var key = ""
- if (path.contains("\\")) {
- // For local paths with backslashes on Windows, URI throws an
exception
- key = env.rpcEnv.fileServer.addJar(new File(path))
+
+ val uri = if (path.contains("\\")) {
+ // If we have backslashes here this is a windows path, and URI
will throws an exception,
+ // so we use this constrcutor instead
--- End diff --
`constructor`
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]