public static short getSegIndex(long globalIndex) {
    return (short) (globalIndex & SchemaFileConfig.SEG_INDEX_MASK);
  }
This method initiate file header buffer, with an empty file if meant to init. <br>

<p><b>File Header Structure:</b>

<ul>
  <li>1 int (4 bytes): last page index {@link #lastPageIndex}
  <li>var length: root(SG) node info
      <ul>
        <li><s>a. var length string (less than 200 bytes): path to root(SG) node</s>
        <li>a. 1 long (8 bytes): dataTTL {@link #dataTTL}
        <li>b. 1 bool (1 byte): isEntityStorageGroup {@link #isEntity}
        <li>c. 1 int (4 bytes): hash code of template name {@link #sgNodeTemplateIdWithState}
        <li>d. 1 long (8 bytes): last segment address of database {@link #lastSGAddr}
        <li>e. 1 int (4 bytes): version of pbtree file {@linkplain
            SchemaFileConfig#SCHEMA_FILE_VERSION}
      </ul>
</ul>

... (Expected to extend for optimization) ...
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/schemafile/SchemaFile.java