Skip to content
Snippets Groups Projects
Commit ce72c72a authored by Cheng Lian's avatar Cheng Lian Committed by Patrick Wendell
Browse files

[Bugfix] Tachyon file cleanup logical error

Should lookup `shutdownDeleteTachyonPaths` instead of `shutdownDeletePaths`. Together with a minor style clean up: `find {...}.isDefined` to `exists {...}`.

Author: Cheng Lian <lian.cs.zju@gmail.com>

Closes #575 from liancheng/tachyonFix and squashes the following commits:

deb8f31 [Cheng Lian] Fixed logical error in when cleanup Tachyon files and minor style cleanup
parent 11d54941
No related branches found
No related tags found
No related merge requests found
......@@ -220,9 +220,9 @@ private[spark] object Utils extends Logging {
def hasRootAsShutdownDeleteDir(file: File): Boolean = {
val absolutePath = file.getAbsolutePath()
val retval = shutdownDeletePaths.synchronized {
shutdownDeletePaths.find { path =>
shutdownDeletePaths.exists { path =>
!absolutePath.equals(path) && absolutePath.startsWith(path)
}.isDefined
}
}
if (retval) {
logInfo("path = " + file + ", already present as root for deletion.")
......@@ -235,10 +235,10 @@ private[spark] object Utils extends Logging {
// paths - resulting in Exception and incomplete cleanup.
def hasRootAsShutdownDeleteDir(file: TachyonFile): Boolean = {
val absolutePath = file.getPath()
val retval = shutdownDeletePaths.synchronized {
shutdownDeletePaths.find { path =>
val retval = shutdownDeleteTachyonPaths.synchronized {
shutdownDeleteTachyonPaths.exists { path =>
!absolutePath.equals(path) && absolutePath.startsWith(path)
}.isDefined
}
}
if (retval) {
logInfo("path = " + file + ", already present as root for deletion.")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment