private void compactKeys() {
    ByteBuffer tempBuffer = ByteBuffer.allocate(this.pageBuffer.capacity() - this.spareOffset);
    tempBuffer.position(tempBuffer.capacity());
    this.spareOffset = (short) this.pageBuffer.capacity();
    String key;
    String name;
    int accSiz = 0;
    for (int i = 0; i < this.memberNum; i++) {
      // this.pageBuffer will not be overridden immediately
      key = getKeyByIndex(i);
      name = getNameByIndex(i);
      accSiz += key.getBytes().length + name.getBytes().length + 8;
      this.spareOffset = (short) (this.pageBuffer.capacity() - accSiz);

      this.pageBuffer.position(SchemaFileConfig.PAGE_HEADER_SIZE + OFFSET_LEN * i);
      ReadWriteIOUtils.write(this.spareOffset, this.pageBuffer);

      // write tempBuffer backward
      tempBuffer.position(tempBuffer.capacity() - accSiz);
      ReadWriteIOUtils.write(key, tempBuffer);
      ReadWriteIOUtils.write(name, tempBuffer);
    }
    tempBuffer.position(tempBuffer.capacity() - accSiz);
    this.pageBuffer.position(this.spareOffset);
    this.pageBuffer.put(tempBuffer);
    this.spareSize =
        (short)
            (this.spareOffset - SchemaFileConfig.PAGE_HEADER_SIZE - OFFSET_LEN * this.memberNum);
  }
<b>Page Header Structure: (19 bytes used, 13 bytes reserved)</b> As in {@linkplain
ISchemaPage}.

<p>Page Body Structure:

<ul>
  <li>2 bytes * memberNum: offset of (alias, name) pair, to locate string content
  <li>... spare space...
  <li>var length(4 byte, var length, 4 bytes, var length): (alias, name) pairs, ordered by
      alias
</ul>
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/schemafile/AliasIndexPage.java