Skip to content

Commit deb8f31

Browse files
committed
Fixed logical error in when cleanup Tachyon files and minor style cleanup
1 parent aa9a7f5 commit deb8f31

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

core/src/main/scala/org/apache/spark/util/Utils.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,9 @@ private[spark] object Utils extends Logging {
215215
def hasRootAsShutdownDeleteDir(file: File): Boolean = {
216216
val absolutePath = file.getAbsolutePath()
217217
val retval = shutdownDeletePaths.synchronized {
218-
shutdownDeletePaths.find { path =>
218+
shutdownDeletePaths.exists { path =>
219219
!absolutePath.equals(path) && absolutePath.startsWith(path)
220-
}.isDefined
220+
}
221221
}
222222
if (retval) {
223223
logInfo("path = " + file + ", already present as root for deletion.")
@@ -230,10 +230,10 @@ private[spark] object Utils extends Logging {
230230
// paths - resulting in Exception and incomplete cleanup.
231231
def hasRootAsShutdownDeleteDir(file: TachyonFile): Boolean = {
232232
val absolutePath = file.getPath()
233-
val retval = shutdownDeletePaths.synchronized {
234-
shutdownDeletePaths.find { path =>
233+
val retval = shutdownDeleteTachyonPaths.synchronized {
234+
shutdownDeleteTachyonPaths.exists { path =>
235235
!absolutePath.equals(path) && absolutePath.startsWith(path)
236-
}.isDefined
236+
}
237237
}
238238
if (retval) {
239239
logInfo("path = " + file + ", already present as root for deletion.")

0 commit comments

Comments
 (0)