protected void burnThroughTransactions(String dbName, String tblName, int num, Set<Long> open, Set<Long> aborted,
      LockRequest lockReq)
      throws MetaException, NoSuchTxnException, TxnAbortedException {
    OpenTxnsResponse rsp = txnHandler.openTxns(new OpenTxnRequest(num, "me", "localhost"));
    AllocateTableWriteIdsRequest awiRqst = new AllocateTableWriteIdsRequest(dbName, tblName);
    awiRqst.setTxnIds(rsp.getTxn_ids());
    AllocateTableWriteIdsResponse awiResp = txnHandler.allocateTableWriteIds(awiRqst);

    long minOpenWriteId = Long.MAX_VALUE;
    if (open != null && useMinHistoryWriteId()) {
      long minOpenTxnId = open.stream().mapToLong(v -> v).min().orElse(-1);
      minOpenWriteId = awiResp.getTxnToWriteIds().stream()
        .filter(v -> v.getTxnId() == minOpenTxnId).map(TxnToWriteId::getWriteId)
        .findFirst().orElse(minOpenWriteId);
    }
    int i = 0;
    for (long tid : rsp.getTxn_ids()) {
      assert (awiResp.getTxnToWriteIds().get(i).getTxnId() == tid);
      ++i;
      if (lockReq != null) {
        lockReq.setTxnid(tid);
        txnHandler.lock(lockReq);
      }
      if (aborted != null && aborted.contains(tid)) {
        txnHandler.abortTxn(new AbortTxnRequest(tid));
      } else if (open == null || !open.contains(tid)) {
        txnHandler.commitTxn(new CommitTxnRequest(tid));
      } else if (open.contains(tid) && useMinHistoryWriteId()){
        txnHandler.addWriteIdsToMinHistory(tid,
          Collections.singletonMap(dbName + "." + tblName, minOpenWriteId));
      }
    }
  }
Super class for all of the compactor test modules.
ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/CompactorTest.java