@Override
    public int truncate(final long logIndex, final int pos) {
        this.writeLock.lock();
        try {
            if (logIndex < this.header.getFirstLogIndex() || logIndex > this.header.getLastLogIndex()) {
                return 0;
            }
            final int slot = (int) (logIndex - this.header.getFirstLogIndex());
            return truncateToSlot(slot);
        } finally {
            this.writeLock.unlock();
        }
    }
Find the index entry
@param  logIndex the target log index
@return a pair holding this offset and its physical file position.
jraft-extension/java-log-storage-impl/src/main/java/com/alipay/sofa/jraft/storage/file/index/IndexFile.java