private void abortReplCreatedOpenTxnsForDatabase(String query) throws TException {
    List<Long> toBeAbortedTxns = null;
    List<TxnType> txnListExcludingReplCreated = new ArrayList<>();
    String pattern = "(?<=REPL LOAD )\\w+(?= INTO \\w+)";
    Pattern regex = Pattern.compile(pattern);
    Matcher matcher = regex.matcher(query);
    String dbName;
    if (matcher.find()) {
      dbName = matcher.group();
      String replPolicy = dbName + ".*";
      for (TxnType type : TxnType.values()) {
        // exclude REPL_CREATED txn
        if (type != TxnType.REPL_CREATED) {
          txnListExcludingReplCreated.add(type);
        }
      }
      List<Long> openTxnList = null;
      GetOpenTxnsResponse openTxnsResponse = null;
      try {
        openTxnsResponse = getTxnHandler()
                .getOpenTxns(txnListExcludingReplCreated);
      } catch (Exception e) {
        LOG.error("Got an error : " + e);
      }
      if (openTxnsResponse != null) {
        openTxnList = openTxnsResponse.getOpen_txns();
        if (openTxnList != null) {
          toBeAbortedTxns = getTxnHandler()
                  .getOpenTxnForPolicy(openTxnList, replPolicy);
          if (!toBeAbortedTxns.isEmpty()) {
            LOG.info("Aborting Repl created open transactions");
            abort_txns(new AbortTxnsRequest(toBeAbortedTxns));
          }
        }
      }
    }
  }
Api to fetch all table constraints at once.
@param request it consist of catalog name, database name and table name to identify the table in metastore
@return all constraints attached to given table
@throws TException
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java