public void updateRecordSegAddr(short segId, String key, long newSegAddr)
      throws SegmentNotFoundException {
    ISegment<ByteBuffer, ICachedMNode> seg = getSegment(segId);
    // TODO: add to interface
    ((WrappedSegment) seg).updateRecordSegAddr(key, newSegAddr);
  }
This method checks and extends the last segment to a designated size.

@param segId segment id
@param oriSegSize size of the target segment
@param newSize extended size
@return extended segment based on page buffer
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/schemafile/SegmentedPage.java