private long getMajorCompactedWriteId(FileStatus[] fileStatuses, boolean replica) {
    for (FileStatus fileStatus : fileStatuses) {
      if (fileStatus.getPath().getName().startsWith(AcidUtils.BASE_PREFIX)) {
        AcidUtils.ParsedBaseLight pbl = AcidUtils.ParsedBase.parseBase(fileStatus.getPath());
        long writeId = pbl.getWriteId();
        if (replica) {
          assertEquals(0, pbl.getVisibilityTxnId());
        }
        return writeId;
      }
    }
    return -1;
  }
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