@TestOnly
  @Override
  public WrappedSegment getSegmentOnTest(short idx) throws SegmentNotFoundException {
    return (WrappedSegment) getSegment(idx);
  }
Register segment instance to segCacheMap and segOffList, modify pageSpareOffset and segNum
respectively

@param seg the segment to register
@return index of the segment
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/schemafile/SegmentedPage.java