private void markPreviousCompactionsAsComplete(TxnStore txnHandler, HiveConf conf) throws Throwable {
    Connection conn = TestTxnDbUtil.getConnection(conf);
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("select CQ_ID from COMPACTION_QUEUE");
    List<Long> openCompactionIds = new ArrayList<>();
    while (rs.next()) {
      openCompactionIds.add(rs.getLong(1));
    }
    openCompactionIds.forEach(id->{
      CompactionInfoStruct compactionInfoStruct = new CompactionInfoStruct();
      compactionInfoStruct.setId(id);
      CompactionInfo compactionInfo = CompactionInfo.compactionStructToInfo(compactionInfoStruct);
      try {
        txnHandler.markCompacted(compactionInfo);
      } catch (MetaException e) {
        throw new RuntimeException(e);
      }
    });
  }
Testcase for getting immutable dataset dump, and its corresponding repl load.
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenariosAcidTables.java