public Pair<Integer, Integer> lookupFirstLogPosFromLogIndex(final long logIndex) {
        final long lastLogIndex = getLastLogIndex();
        int firstSegmentPos = -1;
        int firstConfPos = -1;
        long index = logIndex;
        while (index <= lastLogIndex) {
            final IndexEntry indexEntry = lookupIndex(index);
            if (indexEntry.getLogType() == IndexType.IndexSegment.getType() && firstSegmentPos == -1) {
                firstSegmentPos = indexEntry.getPosition();
            } else if (indexEntry.getLogType() == IndexType.IndexConf.getType() && firstConfPos == -1) {
                firstConfPos = indexEntry.getPosition();
            }
            if (firstSegmentPos > 0 && firstConfPos > 0) {
                break;
            }
            index++;
        }
        return Pair.of(firstSegmentPos, firstConfPos);
    }
Search the first segment log index and first conf log index from logIndex
@return pair of first log pos(segment / conf)
jraft-extension/java-log-storage-impl/src/main/java/com/alipay/sofa/jraft/storage/db/IndexDB.java