Skip to content

Commit

Permalink
check and delete expired log when complete process
Browse files Browse the repository at this point in the history
  • Loading branch information
turboFei committed Nov 6, 2019
1 parent 611ea30 commit 832dd7a
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,12 @@ private[history] class FsHistoryProvider(conf: SparkConf, clock: Clock)
} finally {
endProcessing(reader.rootPath)
pendingReplayTasksCount.decrementAndGet()

val isExpired = scanTime + conf.get(MAX_LOG_AGE_S) * 1000 > clock.getTimeMillis()
if (isExpired) {
listing.delete(classOf[LogInfo], reader.rootPath.toString)
deleteLog(fs, reader.rootPath)
}
}
}

Expand Down

0 comments on commit 832dd7a

Please sign in to comment.