private void runCompaction(String dbName, String tblName, String partName, CompactionType compactionType)
          throws Throwable {
    HiveConf hiveConf = new HiveConf(primary.getConf());
    TxnStore txnHandler = TxnUtils.getTxnStore(hiveConf);
    markPreviousCompactionsAsComplete(txnHandler, hiveConf);
    CompactionRequest rqst = new CompactionRequest(dbName, tblName, compactionType);
    rqst.setPartitionname(partName);
    txnHandler.compact(rqst);
    hiveConf.setBoolVar(HiveConf.ConfVars.COMPACTOR_CRUD_QUERY_BASED, false);
    runWorker(hiveConf);
    runCleaner(hiveConf);
  }
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