private void doCheckpoint() {
        long flushedPosition = getFlushedPosition();
        if (flushedPosition % getDBFileSize() == 0) {
            flushedPosition -= 1;
        }
        final AbstractFile file = this.fileManager.findFileByOffset(flushedPosition, false);
        try {
            if (file != null) {
                this.flushStatusCheckpoint.setFileName(FilenameUtils.getName(file.getFilePath()));
                this.flushStatusCheckpoint.setFlushPosition(flushedPosition);
                this.flushStatusCheckpoint.setLastLogIndex(getLastLogIndex());
                this.flushStatusCheckpoint.save();
            }
        } catch (final IOException e) {
            LOG.error("Error when do checkpoint in db:{}", getDBName());
        }
    }
Recover files
@return last recover offset
jraft-extension/java-log-storage-impl/src/main/java/com/alipay/sofa/jraft/storage/db/AbstractDB.java