Skip to content

Commit f9330d4

Browse files
committed
Clean code again
1 parent 7050d46 commit f9330d4

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

core/src/main/scala/org/apache/spark/executor/Executor.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,13 +323,13 @@ private[spark] class Executor(
323323
for ((name, timestamp) <- newFiles if currentFiles.getOrElse(name, -1L) < timestamp) {
324324
logInfo("Fetching " + name + " with timestamp " + timestamp)
325325
Utils.fetchFile(name, new File(SparkFiles.getRootDirectory), conf,
326-
env.securityManager, hadoopConf, timestamp, true)
326+
env.securityManager, hadoopConf, timestamp, useCache = true)
327327
currentFiles(name) = timestamp
328328
}
329329
for ((name, timestamp) <- newJars if currentJars.getOrElse(name, -1L) < timestamp) {
330330
logInfo("Fetching " + name + " with timestamp " + timestamp)
331331
Utils.fetchFile(name, new File(SparkFiles.getRootDirectory), conf,
332-
env.securityManager, hadoopConf, timestamp, true)
332+
env.securityManager, hadoopConf, timestamp, useCache = true)
333333
currentJars(name) = timestamp
334334
// Add it to our class loader
335335
val localName = name.split("/").last

core/src/main/scala/org/apache/spark/util/Utils.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,11 +313,12 @@ private[spark] object Utils extends Logging {
313313
}
314314

315315
/**
316-
* Download a file requested by the executor . Supports fetching the file in a variety of ways,
316+
* Download a file to target directory. Supports fetching the file in a variety of ways,
317317
* including HTTP, HDFS and files on a standard filesystem, based on the URL parameter.
318318
*
319-
* If `useCache` is true, first attempts to fetch the file from a local cache that's shared across
320-
* executors running the same application.
319+
* If `useCache` is true, first attempts to fetch the file to a local cache that's shared
320+
* across executors running the same application. `useCache` is used mainly for
321+
* the the executors, not in local mode.
321322
*
322323
* Throws SparkException if the target file already exists and has different contents than
323324
* the requested file.
@@ -377,7 +378,7 @@ private[spark] object Utils extends Logging {
377378
}
378379

379380
/**
380-
* Download a file requested by the executor. Supports fetching the file in a variety of ways,
381+
* Download a file to target directory. Supports fetching the file in a variety of ways,
381382
* including HTTP, HDFS and files on a standard filesystem, based on the URL parameter.
382383
*
383384
* Throws SparkException if the target file already exists and has different contents than

0 commit comments

Comments
 (0)