public static void findTxnsFromDump(WarehouseInstance.Tuple tuple, HiveConf conf,
                                      List<Path> openTxns, List<Path> commitTxns, List<Path> abortTxns) throws IOException {
    Path dumpRoot = new Path(tuple.dumpLocation);
    FileSystem fs = FileSystem.get(dumpRoot.toUri(), conf);

    LOG.info("Scanning for event files: " + dumpRoot.toString());
    RemoteIterator<LocatedFileStatus> files = fs.listFiles(dumpRoot, true);
    while(files.hasNext()) {
      LocatedFileStatus status = files.next();

      if (!status.getPath().getName().equals("_dumpmetadata")) {
        continue;
      }

      String event = getEvent(fs, status.getPath());
      if (event.equals("EVENT_OPEN_TXN")) {
        openTxns.add(status.getPath());
      } else if (event.equals("EVENT_COMMIT_TXN")) {
        commitTxns.add(status.getPath());
      } else if (event.equals("EVENT_ABORT_TXN")) {
        abortTxns.add(status.getPath());
      }
    }
  }
ReplicationTestUtils - static helper functions for replication test
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/ReplicationTestUtils.java