private long getTimeSeriesNumber(ISchemaRegion schemaRegion) {
    return schemaRegion.getSchemaRegionStatistics().getSeriesNumber(false)
        + schemaRegion.getSchemaRegionStatistics().getTable2DevicesNumMap().entrySet().stream()
            .map(
                tableEntry -> {
                  final TsTable table =
                      DataNodeTableCache.getInstance()
                          .getTable(
                              PathUtils.unQualifyDatabaseName(schemaRegion.getDatabaseFullPath()),
                              tableEntry.getKey());
                  return Objects.nonNull(table) ? table.getFieldNum() * tableEntry.getValue() : 0;
                })
            .reduce(0L, Long::sum);
  }
Scan the database and schema region directories to recover schema regions and return the
collected local schema partition info for localSchemaPartitionTable recovery.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/SchemaEngine.java