private Set<String> getDbNamesForReplayedTxns(MultiDataSourceJdbcResource jdbcResource, Connection dbConn, 
                                                List<Long> targetTxnIds) throws SQLException {
    Set<String> dbNames = new HashSet<>();
    if (targetTxnIds.isEmpty()) {
      return dbNames;
    }
    List<String> inQueries = new ArrayList<>();
    StringBuilder prefix = new StringBuilder();
    prefix.append("SELECT \"RTM_REPL_POLICY\" FROM \"REPL_TXN_MAP\" WHERE ");
    TxnUtils.buildQueryWithINClause(jdbcResource.getConf(), inQueries, prefix, new StringBuilder(), targetTxnIds,
        "\"RTM_TARGET_TXN_ID\"", false, false);
    for (String query : inQueries) {
      LOG.debug("Going to execute select <{}>", query);
      try (PreparedStatement pst = jdbcResource.getSqlGenerator().prepareStmtWithParameters(dbConn, query, null);
           ResultSet rs = pst.executeQuery()) {
        while (rs.next()) {
          dbNames.add(MetaStoreUtils.getDbNameFromReplPolicy(rs.getString(1)));
        }
      }
    }
    return dbNames;
  }
@param jdbcResource A {@link MultiDataSourceJdbcResource} instance responsible for providing all the necessary 
                    resources to be able to perform transactional database calls.
@return 0 if skipCount is true, the number of aborted transactions otherwise
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/jdbc/functions/AbortTxnsFunction.java