@SuppressWarnings("java:S2142")
  private void initSchemaRegion() {
    // recover SchemaRegion concurrently
    final Map<String, List<SchemaRegionId>> localSchemaRegionInfo = getLocalSchemaRegionInfo();
    final ExecutorService schemaRegionRecoverPools =
        IoTDBThreadPoolFactory.newFixedThreadPool(
            Runtime.getRuntime().availableProcessors(),
            ThreadName.SCHEMA_REGION_RECOVER_TASK.getName());
    final List<Future<ISchemaRegion>> futures = new ArrayList<>();
    localSchemaRegionInfo.forEach(
        (k, v) ->
            v.forEach(
                schemaRegionId ->
                    futures.add(
                        schemaRegionRecoverPools.submit(
                            recoverSchemaRegionTask(k, schemaRegionId)))));
    for (final Future<ISchemaRegion> future : futures) {
      try {
        final ISchemaRegion schemaRegion = future.get();
        schemaRegionMap.put(schemaRegion.getSchemaRegionId(), schemaRegion);
      } catch (final ExecutionException | InterruptedException | RuntimeException e) {
        logger.error("Something wrong happened during SchemaRegion recovery", e);
      }
    }
    schemaRegionRecoverPools.shutdown();
  }
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