private void fetchFailoverMetadata(Hive hiveDb) throws HiveException, IOException, TException {
    Path hiveDumpDir = new Path(work.getCurrentDumpPath(), ReplUtils.REPL_HIVE_BASE_DIR);
    FailoverMetaData fmd = new FailoverMetaData(hiveDumpDir, conf);
    FileSystem fs = hiveDumpDir.getFileSystem(conf);
    if (fs.exists(new Path(hiveDumpDir, FailoverMetaData.FAILOVER_METADATA)) && fmd.isValidMetadata()) {
      work.setFailoverMetadata(fmd);
      return;
    }
    HiveTxnManager hiveTxnManager = getTxnMgr();
    List<Long> txnsForDb = getOpenTxns(hiveTxnManager, hiveTxnManager.getValidTxns(excludedTxns), work.dbNameOrPattern);
    if (!txnsForDb.isEmpty()) {
      LOG.debug("Going to abort transactions: {} for database: {}.", txnsForDb, work.dbNameOrPattern);
      hiveDb.abortTransactions(txnsForDb, TxnErrorMsg.ABORT_FETCH_FAILOVER_METADATA.getErrorCode());
    }
    fmd.setAbortedTxns(txnsForDb);
    fmd.setCursorPoint(currentNotificationId(hiveDb));
    ValidTxnList allValidTxns = getTxnMgr().getValidTxns(excludedTxns);
    List<Long> openTxns = getOpenTxns(allValidTxns);
    fmd.setOpenTxns(openTxns);
    fmd.setTxnsWithoutLock(getTxnsNotPresentInHiveLocksTable(openTxns));
    txnsForDb = getOpenTxns(hiveTxnManager, allValidTxns, work.dbNameOrPattern);
    if (!txnsForDb.isEmpty()) {
      LOG.debug("Going to abort transactions: {} for database: {}.", txnsForDb, work.dbNameOrPattern);
      hiveDb.abortTransactions(txnsForDb, TxnErrorMsg.ABORT_FETCH_FAILOVER_METADATA.getErrorCode());
      fmd.addToAbortedTxns(txnsForDb);
    }
    fmd.setFailoverEventId(currentNotificationId(hiveDb));
    fmd.write();
    work.setFailoverMetadata(fmd);
  }
Decide whether to dump ACID tables.
@param tableName - Name of ACID table to be replicated
@return true if need to bootstrap dump ACID table and false if not.
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplDumpTask.java