public Pair<Integer, Long> appendIndexAsync(final long logIndex, final int position, final IndexType type) {
        final long lastIndex = getLastLogIndex();
        if (lastIndex != -1 && logIndex != getLastLogIndex() + 1) {
            return Pair.of(-1, (long) -1);
        }
        final int waitToWroteSize = IndexEntry.INDEX_SIZE;
        final IndexFile indexFile = (IndexFile) this.fileManager.getLastFile(logIndex, waitToWroteSize, true);
        if (indexFile != null) {
            final int pos = indexFile.appendIndex(logIndex, position, type.getType());
            final long expectFlushPosition = indexFile.getFileFromOffset() + pos + waitToWroteSize;
            return Pair.of(pos, expectFlushPosition);
        }
        return Pair.of(-1, (long) -1);
    }
Append IndexEntry(logIndex , position, indexType)
@return (wrotePosition, expectFlushPosition)
jraft-extension/java-log-storage-impl/src/main/java/com/alipay/sofa/jraft/storage/db/IndexDB.java