diff options
author | nemccarthy <nathan@nemccarthy.me> | 2015-03-17 09:33:11 -0700 |
---|---|---|
committer | Josh Rosen <joshrosen@databricks.com> | 2015-03-17 09:33:11 -0700 |
commit | 4cca3917dc30ee907e6cbd6a569b6ac58af963f7 (patch) | |
tree | 21f6641ed149e0c9ae9bc72c30166abae4da87b8 /core | |
parent | 0f673c21f68ee3d5df3c01ae405709d3c1f4909b (diff) | |
download | spark-4cca3917dc30ee907e6cbd6a569b6ac58af963f7.tar.gz spark-4cca3917dc30ee907e6cbd6a569b6ac58af963f7.tar.bz2 spark-4cca3917dc30ee907e6cbd6a569b6ac58af963f7.zip |
[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 <nathan@nemccarthy.me>
Closes #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
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/scala/org/apache/spark/util/Utils.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/src/main/scala/org/apache/spark/util/Utils.scala b/core/src/main/scala/org/apache/spark/util/Utils.scala index d3dc1d09cb..af8a24553a 100644 --- a/core/src/main/scala/org/apache/spark/util/Utils.scala +++ b/core/src/main/scala/org/apache/spark/util/Utils.scala @@ -403,7 +403,8 @@ private[spark] object Utils extends Logging { useCache: Boolean) { val fileName = url.split("/").last val targetFile = new File(targetDir, fileName) - if (useCache) { + val fetchCacheEnabled = conf.getBoolean("spark.files.useFetchCache", defaultValue = true) + if (useCache && fetchCacheEnabled) { val cachedFileName = s"${url.hashCode}${timestamp}_cache" val lockFileName = s"${url.hashCode}${timestamp}_lock" val localDir = new File(getLocalDir(conf)) |