public Map<String, List<Pair<TsTable, TableNodeStatus>>> getAllTables() {
    return getAllDatabasePaths(true).stream()
        .collect(
            Collectors.toMap(
                databasePath -> PathUtils.unQualifyDatabaseName(databasePath.getFullPath()),
                databasePath -> {
                  try {
                    return getAllTablesUnderSpecificDatabase(databasePath);
                  } catch (final MetadataException ignore) {
                    // Database path must exist because the "getAllDatabasePaths()" is called in
                    // databaseReadWriteLock.readLock().
                  }
                  return Collections.emptyList();
                }));
  }
This method returns the templateId set on paths if the path set matches or is a prefix of input
path pattern.
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/schema/ConfigMTree.java