private boolean closeTxn(String qualifiedTableName, boolean success, long txnId) {
    boolean ret = true;
    if (success) {
      try {
        LOG.info("txnId: {} succeeded. Committing..", txnId);
        getMsc().commitTxn(txnId);
      } catch (Exception e) {
        LOG.error("Error while committing txnId: {} for table: {}", txnId, qualifiedTableName, e);
        ret = false;
      }
    } else {
      LOG.info("txnId: {} failed. Aborting..", txnId);
      AbortTxnRequest abortTxnRequest = new AbortTxnRequest(txnId);
      abortTxnRequest.setErrorCode(TxnErrorMsg.ABORT_MSCK_TXN.getErrorCode());
      try {
        getMsc().rollbackTxn(abortTxnRequest);
      } catch (Exception e) {
        LOG.error("Error while aborting txnId: {} for table: {}", txnId, qualifiedTableName, e);
        ret = false;
      }
    }
    return ret;
  }
MetastoreCheck, see if the data in the metastore matches what is on the
dfs. Current version checks for tables and partitions that are either
missing on disk on in the metastore.

@param msckInfo Information about the tables and partitions we want to check for.
@return Returns 0 when execution succeeds and above 0 if it fails.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/Msck.java