public void initAndMap(final String filePath, final int fileSize, final boolean isMapped) {
        this.filePath = filePath;
        this.fileSize = fileSize;
        this.file = new File(filePath);
        this.mapLock.lock();
        try {
            if (!this.file.exists()) {
                if (!this.file.createNewFile()) {
                    throw new RuntimeException("Failed to create new file");
                }
            }
            if (isMapped) {
                this.map(MapMode.READ_WRITE);
            }
        } catch (final Throwable t) {
            LOG.error("Error happen when create file:{}", filePath, 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