Skip to content

Commit 4cca391

Browse files
nemccarthyJoshRosen
authored andcommitted
[SPARK-6313] Add config option to disable file locks/fetchFile cache to ...
...support NFS mounts. This is a work around for now with the goal to find a more permanent solution. https://issues.apache.org/jira/browse/SPARK-6313 Author: nemccarthy <[email protected]> Closes apache#5036 from nemccarthy/master and squashes the following commits: 2eaaf42 [nemccarthy] [SPARK-6313] Update config wording doc for spark.files.useFetchCache 5de7eb4 [nemccarthy] [SPARK-6313] Add config option to disable file locks/fetchFile cache to support NFS mounts
1 parent 0f673c2 commit 4cca391

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,8 @@ private[spark] object Utils extends Logging {
403403
useCache: Boolean) {
404404
val fileName = url.split("/").last
405405
val targetFile = new File(targetDir, fileName)
406-
if (useCache) {
406+
val fetchCacheEnabled = conf.getBoolean("spark.files.useFetchCache", defaultValue = true)
407+
if (useCache && fetchCacheEnabled) {
407408
val cachedFileName = s"${url.hashCode}${timestamp}_cache"
408409
val lockFileName = s"${url.hashCode}${timestamp}_lock"
409410
val localDir = new File(getLocalDir(conf))

docs/configuration.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,18 @@ Apart from these, the following properties are also available, and may be useful
745745
the driver, in seconds.
746746
</td>
747747
</tr>
748+
<tr>
749+
<td><code>spark.files.useFetchCache</code></td>
750+
<td>true</td>
751+
<td>
752+
If set to true (default), file fetching will use a local cache that is shared by executors
753+
that belong to the same application, which can improve task launching performance when
754+
running many executors on the same host. If set to false, these caching optimizations will
755+
be disabled and all executors will fetch their own copies of files. This optimization may be
756+
disabled in order to use Spark local directories that reside on NFS filesystems (see
757+
<a href="https://issues.apache.org/jira/browse/SPARK-6313">SPARK-6313</a> for more details).
758+
</td>
759+
</tr>
748760
<tr>
749761
<td><code>spark.files.overwrite</code></td>
750762
<td>false</td>

0 commit comments

Comments
 (0)