Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/3233#discussion_r24304756
--- Diff: core/src/main/scala/org/apache/spark/executor/Executor.scala ---
@@ -344,18 +353,20 @@ private[spark] class Executor(
env.securityManager, hadoopConf, timestamp, useCache = !isLocal)
currentFiles(name) = timestamp
}
- for ((name, timestamp) <- newJars if currentJars.getOrElse(name,
-1L) < timestamp) {
- logInfo("Fetching " + name + " with timestamp " + timestamp)
- // Fetch file with useCache mode, close cache for local mode.
- Utils.fetchFile(name, new File(SparkFiles.getRootDirectory), conf,
- env.securityManager, hadoopConf, timestamp, useCache = !isLocal)
- currentJars(name) = timestamp
- // Add it to our class loader
+ for ((name, timestamp) <- newJars) {
val localName = name.split("/").last
- val url = new File(SparkFiles.getRootDirectory,
localName).toURI.toURL
- if (!urlClassLoader.getURLs.contains(url)) {
- logInfo("Adding " + url + " to class loader")
- urlClassLoader.addURL(url)
+ if
(currentJars.get(name).orElse(currentJars.get(localName)).getOrElse(-1L) <
timestamp) {
--- End diff --
can you put this in a variable, something like
```
val existingTimestamp = currentJars.get(name)
.orElse(currentJars.get(localName))
.getOrElse(-1L)
if (existingTimestamp < timestamp) {
...
}
```
Also, why do we check for the `localName` here but not before?
---
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]