public void map(final MapMode mapMode) {
        this.mapLock.lock();
        try {
            if (!isMapped()) {
                try (final RandomAccessFile randomAccessFile = new RandomAccessFile(this.file, "rw");
                        final FileChannel fileChannel = randomAccessFile.getChannel()) {
                    this.mappedByteBuffer = fileChannel.map(mapMode, 0, this.fileSize);
                    this.isMapped = true;
                }
            }
        } catch (final Throwable t) {
            LOG.error("map file {} failed , {}", getFilePath(), t);
            throw new RuntimeException(t);
        } finally {
            this.mapLock.unlock();
        }
    }
File parent class that wrappers uniform functions such as mmap(), flush() etc..
@author hzh (642256541@qq.com)
jraft-extension/java-log-storage-impl/src/main/java/com/alipay/sofa/jraft/storage/file/AbstractFile.java