code: public Segment createSegment(SegmentDescriptor descriptor) {
      switch (storage.level()) {
        case MEMORY:
          return createMemorySegment(descriptor);
        case MAPPED:
          if (descriptor.version() == 1) {
            return createMappedSegment(descriptor);
          } else {
            return createDiskSegment(descriptor);
          }
        case DISK:
          return createDiskSegment(descriptor);
        default:
          throw new AssertionError();
      }
    }
docs: Creates a new segment.