@TestOnly
  public String checkAllContexts() {
    StringBuilder builder = new StringBuilder();

    for (SchemaPageContext cxt : threadContexts.values()) {
      builder.append(
          String.format(
              "cxt[%d] has %d pages, %d lock trace\n",
              cxt.threadID, cxt.referredPages.size(), cxt.lockTraces.size()));
    }

    return builder.toString();
  }
This method {@linkplain #reEstimateSegSize} is called when {@linkplain
SchemaPageOverflowException} occurs. It is designed to accelerate when there is lots of new
children nodes, avoiding segments extend several times.

<p>Notice that SegmentOverflowException inside a page with sufficient space will not reach
here. Supposed to merge with SchemaFile#reEstimateSegSize.

@param expSize expected size calculated from next new record
@param batchSize size of children within one #writeNewChildren(ICachedMNode)
@return estimated size
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/schemafile/pagemgr/PageManager.java