public boolean recoverAndLoad() {
        this.writeLock.lock();
        try {
            this.indexDB.recover();
            this.segmentLogDB.recover();
            this.confDB.recover();

            // Check consistency
            if (!checkConsistencyAndAlignLog()) {
                LOG.warn("Check the consistency and align log failed");
                return false;
            }

            // Load configuration to conf manager
            loadConfiguration();

            // Set first log index
            if (!this.firstLogIndexCheckpoint.isInit()) {
                saveFirstLogIndex(this.indexDB.getFirstLogIndex());
            }
            LOG.info("Recover dbs and start timingServer success, last recover index:{}",
                this.indexDB.getLastLogIndex());
            return true;
        } catch (final Exception e) {
            LOG.error("Error on recover db", e);
            return false;
        } finally {
            this.writeLock.unlock();
        }
    }
A logStorage implemented by java
@author hzh (642256541@qq.com)
jraft-extension/java-log-storage-impl/src/main/java/com/alipay/sofa/jraft/storage/LogitLogStorage.java