@Override
  public synchronized short allocNewSegment(short size) throws MetadataException {
    ISegment<ByteBuffer, ICachedMNode> newSeg =
        WrappedSegment.initAsSegment(allocSpareBufferSlice(size));

    if (newSeg == null) {
      compactSegments();
      newSeg = WrappedSegment.initAsSegment(allocSpareBufferSlice(size));
    }

    if (newSeg == null) {
      throw new SchemaPageOverflowException(pageIndex);
    }

    return registerNewSegment(newSeg);
  }
Implementing marking deletion will not modify {@linkplain #memberNum} nor truncate {@linkplain
#segOffsetLst}.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/schemafile/SegmentedPage.java