private SegmentFile allocateSegmentFile(final long index) throws InterruptedException, IOException {
        this.allocateLock.lock();
        try {
            while (this.blankSegments.isEmpty()) {
                this.emptyCond.await();
            }
            final AllocatedResult result = this.blankSegments.pollFirst();
            if (result.ie != null) {
                throw result.ie;
            }
            this.fullCond.signal();
            result.segmentFile.setFirstLogIndex(index);
            this.segments.add(result.segmentFile);
            return result.segmentFile;
        } finally {
            this.allocateLock.unlock();
        }
    }
Creates a RocksDBSegmentLogStorage builder.
@return a builder instance.
jraft-core/src/main/java/com/alipay/sofa/jraft/storage/log/RocksDBSegmentLogStorage.java