mUfs.delete(mJournal.getCheckpointFilePath(), false); mUfs.rename(mTempCheckpointPath, mJournal.getCheckpointFilePath()); mUfs.delete(mTempCheckpointPath, false); LOG.info("Renamed checkpoint file " + mTempCheckpointPath + " to "
/** * Moves the current log file to the completed folder, marking it as complete. If successful, the * current log file will no longer exist. The current log must already be closed before this call. * * @throws IOException */ private void completeCurrentLog() throws IOException { String currentLog = mJournal.getCurrentLogFilePath(); if (!mUfs.exists(currentLog)) { // All logs are already complete, so nothing to do. return; } if (!mUfs.exists(mCompletedDirectory)) { mUfs.mkdirs(mCompletedDirectory, true); } String completedLog = mJournal.getCompletedLogFilePath(mNextCompleteLogNumber); mUfs.rename(currentLog, completedLog); LOG.info("Completed current log: " + currentLog + " to completed log: " + completedLog); mNextCompleteLogNumber ++; }
tmpPath = PathUtils.temporaryFileName(fileId, nonce, ufsPath); if (!ufs.rename(tmpPath, ufsPath)) { throw new FailedToCheckpointException("Failed to rename " + tmpPath + " to " + ufsPath);
return false; if (!ufs.rename(ufsSrcPath, ufsDstPath)) { LOG.error("Failed to rename " + ufsSrcPath + " to " + ufsDstPath); return false;