private SegmentFile allocateNewSegmentFile() throws IOException {
        final String newSegPath = getNewSegmentFilePath();
        SegmentFile segmentFile = new SegmentFile(this.maxSegmentFileSize, newSegPath, this.writeExecutor);
        final SegmentFileOptions opts = SegmentFileOptions.builder() //
            .setSync(false) //
            .setRecover(false) //
            .setLastFile(true) //
            .setNewFile(true) //
            .setPos(0).build();

        try {
            if (!segmentFile.init(opts)) {
                throw new IOException("Fail to create new segment file");
            }
            segmentFile.hintLoad();
            LOG.info("Create a new segment file {}.", segmentFile.getPath());
            return segmentFile;
        } catch (IOException e) {
            // Delete the file if fails
            FileUtils.deleteQuietly(new File(newSegPath));
            throw e;
        }
    }
Creates a RocksDBSegmentLogStorage builder.
@return a builder instance.
jraft-core/src/main/java/com/alipay/sofa/jraft/storage/log/RocksDBSegmentLogStorage.java