@SuppressWarnings("squid:S3776")
  private int initFromLog() throws IOException {
    final File logFile =
        SystemFileFactory.INSTANCE.getFile(
            schemaRegionDirPath + File.separator + SchemaConstant.METADATA_LOG);

    final long time = System.currentTimeMillis();
    // init the metadata from the operation log
    if (logFile.exists()) {
      final int idx;
      try (final SchemaLogReader<ISchemaRegionPlan> mLogReader =
          new SchemaLogReader<>(
              schemaRegionDirPath,
              SchemaConstant.METADATA_LOG,
              new FakeCRC32Deserializer<>(new SchemaRegionPlanDeserializer()))) {
        idx = applyMLog(mLogReader);
        logger.debug(
            "spend {} ms to deserialize {} mtree from mlog.bin",
            System.currentTimeMillis() - time,
            databaseFullPath);
        return idx;
      } catch (final Exception e) {
        e.printStackTrace();
        throw new IOException("Failed to parse " + databaseFullPath + " mlog.bin for err:" + e);
      }
    } else {
      return 0;
    }
  }
Init from metadata log file.

@return line number of the logFile
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/impl/SchemaRegionMemoryImpl.java