-
Notifications
You must be signed in to change notification settings - Fork 29k
SPARK-1623. Broadcast cleaner should use getCanonicalPath when deleting files by name #546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -213,7 +213,7 @@ private[spark] object HttpBroadcast extends Logging { | |
| SparkEnv.get.blockManager.master.removeBroadcast(id, removeFromDriver, blocking) | ||
| if (removeFromDriver) { | ||
| val file = getFile(id) | ||
| files.remove(file.toString) | ||
| files.remove(file.getCanonicalPath) | ||
| deleteBroadcastFile(file) | ||
| } | ||
| } | ||
|
|
@@ -229,7 +229,7 @@ private[spark] object HttpBroadcast extends Logging { | |
| val (file, time) = (entry.getKey, entry.getValue) | ||
| if (time < cleanupTime) { | ||
| iterator.remove() | ||
| deleteBroadcastFile(new File(file.toString)) | ||
| deleteBroadcastFile(new File(file.getCanonicalPath)) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this be
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (Removed my earlier incorrect comment) @techaddict is correct since the value
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure Sean, I think I agree with you cause hashSet entries are string: private val files = new TimeStampedHashSet[String] and I am making it to deleteBroadcastFile(new File(file)) as per your Niraj On Thu, Apr 24, 2014 at 10:52 PM, Sean Owen [email protected]:
|
||
| } | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm and also note that the file names are added using the value of
getAbsolutePath(). If its absolute path were not-canonicalized it would not work.Why not just have
Fileobjects in the setfiles? They implement the desiredequals()semantics:http://docs.oracle.com/javase/7/docs/api/java/io/File.html#equals(java.lang.Object)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tried both of the following :
In both the cases IDE complaints !
Niraj
On Thu, Apr 24, 2014 at 10:21 PM, Sean Owen [email protected]: