public static void prepareAbortTxnsFile(List<NotificationEvent> notificationEvents, Set<Long> allOpenTxns,
                                          Path dumpPath, HiveConf conf) throws SemanticException {
    if (notificationEvents.size() == 0) {
      return;
    }
    Set<Long> txnsOpenedPostCurrEventId = new HashSet<>();
    MessageDeserializer deserializer = ReplUtils.getEventDeserializer(notificationEvents.get(0));
    for (NotificationEvent event: notificationEvents) {
      switch (event.getEventType()) {
        case MessageBuilder.OPEN_TXN_EVENT:
          OpenTxnMessage openTxnMessage = deserializer.getOpenTxnMessage(event.getMessage());
          txnsOpenedPostCurrEventId.addAll(openTxnMessage.getTxnIds());
          allOpenTxns.removeAll(openTxnMessage.getTxnIds());
          break;
        case MessageBuilder.ABORT_TXN_EVENT:
          AbortTxnMessage abortTxnMessage = deserializer.getAbortTxnMessage(event.getMessage());
          if (!txnsOpenedPostCurrEventId.contains(abortTxnMessage.getTxnId())) {
            allOpenTxns.add(abortTxnMessage.getTxnId());
          }
          break;
        case MessageBuilder.COMMIT_TXN_EVENT:
          CommitTxnMessage commitTxnMessage = deserializer.getCommitTxnMessage(event.getMessage());
          if (!txnsOpenedPostCurrEventId.contains(commitTxnMessage.getTxnId())) {
            allOpenTxns.add(commitTxnMessage.getTxnId());
          }
          break;
      }
    }
    if (!allOpenTxns.isEmpty()) {
      Utils.writeOutput(flattenListToString(allOpenTxns), new Path(dumpPath, ABORT_TXNS_FILE), conf);
    }
  }
Gets &amp; checks whether the database is target of replication.
@param dbName name of database
@param hive hive object
@return true, if the database has repl.target.for property set.
@throws HiveException
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/OptimisedBootstrapUtils.java