public List<PartialPath> getBelongedDatabases(final PartialPath pathPattern)
      throws MetadataException {
    return collectDatabases(pathPattern, ALL_MATCH_SCOPE, false, true);
  }
Get the database that given path pattern matches or belongs to.

<p>Suppose we have (root.sg1.d1.s1, root.sg2.d2.s2), refer the following cases: 1. given path
"root.sg1", ("root.sg1") will be returned. 2. given path "root.*", ("root.sg1", "root.sg2")
will be returned. 3. given path "root.*.d1.s1", ("root.sg1", "root.sg2") will be returned.

@param pathPattern a path pattern or a full path
@return a list contains all databases related to given path
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/schema/ConfigMTree.java