public CountDatabaseResp countMatchedDatabases(final CountDatabasePlan countDatabasePlan) {
    try {
      return (CountDatabaseResp) getConsensusManager().read(countDatabasePlan);
    } catch (final ConsensusException e) {
      LOGGER.warn(CONSENSUS_READ_ERROR, e);
      final TSStatus res = new TSStatus(TSStatusCode.EXECUTE_STATEMENT_ERROR.getStatusCode());
      res.setMessage(e.getMessage());
      final CountDatabaseResp response = new CountDatabaseResp();
      response.setStatus(res);
      return response;
    }
  }
Count Databases by specified path pattern. Notice: including pre-deleted Database.

<p>Notice: Only invoke this interface in ConfigManager

@return CountDatabaseResp
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/schema/ClusterSchemaManager.java