public List<String> getDatabaseNames(final Boolean isTableModel) {
    databaseReadWriteLock.readLock().lock();
    try {
      final List<String> results = new ArrayList<>();
      if (!Boolean.TRUE.equals(isTableModel)) {
        treeModelMTree.getAllDatabasePaths(isTableModel).stream()
            .map(PartialPath::getFullPath)
            .forEach(results::add);
      }
      if (!Boolean.FALSE.equals(isTableModel)) {
        tableModelMTree.getAllDatabasePaths(isTableModel).stream()
            .map(path -> path.getNodes()[1])
            .forEach(results::add);
      }
      return results;
    } finally {
      databaseReadWriteLock.readLock().unlock();
    }
  }
Only leader use this interface.

@return List {@literal <}DatabaseName{@literal >}, all Databases' name.
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/schema/ClusterSchemaInfo.java