code: private Segment createMappedSegment(SegmentDescriptor descriptor) {
      File segmentFile = SegmentFile.createSegmentFile(name, storage.directory(), descriptor.id(), descriptor.version());
      Buffer buffer = MappedBuffer.allocate(segmentFile, Math.min(DEFAULT_BUFFER_SIZE, descriptor.maxSegmentSize()), Integer.MAX_VALUE);
      descriptor.copyTo(buffer);
      Segment segment = new Segment(new SegmentFile(segmentFile), buffer.slice(), descriptor, createIndex(descriptor), new OffsetPredicate(), serializer.clone(), this);
      LOGGER.debug("Created segment: {}", segment);
      return segment;
    }
docs: Creates a new segment.