Skip to content

Commit

Permalink
add comment for FileLock
Browse files Browse the repository at this point in the history
  • Loading branch information
li-zhihui committed Sep 4, 2014
1 parent e0ebd48 commit 2ffd742
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/src/main/scala/org/apache/spark/util/Utils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,10 @@ private[spark] object Utils extends Logging {
val localDir = new File(getLocalDir(conf))
val lockFile = new File(localDir, lockFileName)
val raf = new RandomAccessFile(lockFile, "rw")
val lock = raf.getChannel().lock() // only one executor entry
// Only one executor entry.
// The FileLock is only used to control synchronization for executors download file,
// it's always safe regardless of lock type(mandatory or advisory).
val lock = raf.getChannel().lock()
val cachedFile = new File(localDir, cachedFileName)
try {
if (!cachedFile.exists()) {
Expand Down

0 comments on commit 2ffd742

Please sign in to comment.