@Override
  public ICachedMNode init() throws MetadataException {
    ICachedMNode resNode;
    String[] sgPathNodes =
        storageGroupName == null
            ? new String[] {"noName"}
            : PathUtils.splitPathToDetachedNodes(storageGroupName);
    if (isEntity) {
      resNode =
          setNodeAddress(
              nodeFactory.createDatabaseDeviceMNode(null, sgPathNodes[sgPathNodes.length - 1]), 0L);
      resNode.getAsDeviceMNode().setSchemaTemplateId(sgNodeTemplateIdWithState);
      resNode.getAsDeviceMNode().setUseTemplate(sgNodeTemplateIdWithState > -1);
    } else {
      resNode =
          setNodeAddress(
              nodeFactory
                  .createDatabaseMNode(null, sgPathNodes[sgPathNodes.length - 1])
                  .getAsMNode(),
              0L);
    }
    resNode.setFullPath(storageGroupName);
    return resNode;
  }
This class is mainly aimed to manage space all over the file.

<p>This class is meant to open a .pst(Persistent mTree) file, and maintains the header of the
file. It Loads or writes a page length bytes at once, with an 32 bits int to index a page inside
a file. Use SlottedFile to manipulate segment(sp) inside a page(an array of bytes).
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/schemafile/SchemaFile.java