aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorCheng Lian <lian.cs.zju@gmail.com>2014-05-03 13:23:52 -0700
committerPatrick Wendell <pwendell@gmail.com>2014-05-03 13:23:52 -0700
commitce72c72aecdcf50e031f0dd1a5ef0e6dbf8f40b5 (patch)
treefb611051c9ff7543326e1fa53bafa52edb161eb6 /core
parent11d54941760f86706e28f7ace8ece664c9164ba6 (diff)
downloadspark-ce72c72aecdcf50e031f0dd1a5ef0e6dbf8f40b5.tar.gz
spark-ce72c72aecdcf50e031f0dd1a5ef0e6dbf8f40b5.tar.bz2
spark-ce72c72aecdcf50e031f0dd1a5ef0e6dbf8f40b5.zip
[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
Diffstat (limited to 'core')
-rw-r--r--core/src/main/scala/org/apache/spark/util/Utils.scala10
1 files changed, 5 insertions, 5 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 536a740140..acd7eef6d2 100644
--- a/core/src/main/scala/org/apache/spark/util/Utils.scala
+++ b/core/src/main/scala/org/apache/spark/util/Utils.scala
@@ -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.")