code: public void update(URI location) {
      try {
        if (mUfs.isFile(mCheckpoint.toString())) {
          UnderFileSystemUtils.deleteFileIfExists(mUfs, mTempBackupCheckpoint.toString());
          UnderFileSystemUtils.deleteFileIfExists(mUfs, mBackupCheckpoint.toString());
          // Rename in two steps so that we never have identical mCheckpointPath and
          // mBackupCheckpointPath. This is a concern since UFS may implement rename as copy + delete.
          mUfs.renameFile(mCheckpoint.toString(), mTempBackupCheckpoint.toString());
          mUfs.renameFile(mTempBackupCheckpoint.toString(), mBackupCheckpoint.toString());
          LOG.info("Backed up the checkpoint file to {}", mBackupCheckpoint.toString());
        }
        mUfs.renameFile(location.getPath(), mCheckpoint.toString());
        LOG.info("Renamed the checkpoint file from {} to {}", location,
            mCheckpoint.toString());
  
        // The checkpoint already reflects the information in the completed logs.
        mWriter.deleteCompletedLogs();
        UnderFileSystemUtils.deleteFileIfExists(mUfs, mBackupCheckpoint.toString());
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    }
docs: Updates the checkpoint to the specified URI.
  
  @param location the location of the new checkpoint