public int appendIndex(final long logIndex, final int position, final byte logType) {
        this.writeLock.lock();
        try {
            assert (logIndex > getLastLogIndex());
            final byte[] writeData = encodeData(toRelativeOffset(logIndex), position, logType);
            return doAppend(logIndex, writeData);
        } finally {
            this.writeLock.unlock();
        }
    }
Write the index entry
 @param logIndex the log index
@param position the physical position
@param logType [1] means logEntry , [2] means confEntry
jraft-extension/java-log-storage-impl/src/main/java/com/alipay/sofa/jraft/storage/file/index/IndexFile.java