Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ class CheckpointWriter(
+ "'")

// Write checkpoint to temp file
fs.delete(tempFile, true) // just in case it exists
if (fs.exists(tempFile)) {
fs.delete(tempFile, true) // just in case it exists
}
val fos = fs.create(tempFile)
Utils.tryWithSafeFinally {
fos.write(bytes)
Expand All @@ -203,7 +205,9 @@ class CheckpointWriter(
// If the checkpoint file exists, back it up
// If the backup exists as well, just delete it, otherwise rename will fail
if (fs.exists(checkpointFile)) {
fs.delete(backupFile, true) // just in case it exists
if (fs.exists(backupFile)){
fs.delete(backupFile, true) // just in case it exists
}
if (!fs.rename(checkpointFile, backupFile)) {
logWarning("Could not rename " + checkpointFile + " to " + backupFile)
}
Expand Down