public void sortIntoBucket(ISchemaPage page, short newSegSize) {
    if (page.getAsSegmentedPage() == null) {
      return;
    }

    // actual space occupied by a segment includes both its own length and the length of its
    // offset. so available length for a segment is the spareSize minus the offset bytes
    short availableSize =
        newSegSize < 0
            ? (short) (page.getAsSegmentedPage().getSpareSize() - SchemaFileConfig.SEG_OFF_DIG)
            : (short)
                (page.getAsSegmentedPage().getSpareSize()
                    - newSegSize
                    - SchemaFileConfig.SEG_OFF_DIG);

    // too small to index
    if (availableSize <= SchemaFileConfig.SEG_HEADER_SIZE) {
      return;
    }

    // be like: SEG_HEADER < buckets[0] <= bounds[0] < buckets[1] <= ...
    for (int i = 0; i < bounds.length; i++) {
      // the last of SEG_SIZE_LST is the maximum page size, definitely larger than others
      if (availableSize <= bounds[i]) {
        buckets[i].add(page.getPageIndex());
        return;
      }
    }
  }
* Index buckets affiliated to a page collection. Indexes are sort into buckets according to spare
space of its corresponding page instance.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/schemafile/pagemgr/PageIndexSortBuckets.java