@Override
    public void clearBufferedLogs() {
        boolean doUnlock = true;
        this.writeLock.lock();
        try {
            if (this.lastSnapshotId.getIndex() != 0) {
                doUnlock = false;
                //unlock in truncatePrefix
                truncatePrefix(this.lastSnapshotId.getIndex() + 1, this.writeLock);
            }
        } finally {
            if (doUnlock) {
                this.writeLock.unlock();
            }
        }
    }
Adds event to disk queue, NEVER call it in lock.
@param done
@param type
jraft-core/src/main/java/com/alipay/sofa/jraft/storage/impl/LogManagerImpl.java