void dumpConstraintMetadata(String dbName, String tblName, Path dbRoot, Hive hiveDb, long tableId) throws Exception {
    try {
      Path constraintsRoot = new Path(dbRoot, ReplUtils.CONSTRAINTS_ROOT_DIR_NAME);
      Path commonConstraintsFile = new Path(constraintsRoot, ConstraintFileType.COMMON.getPrefix() + tblName);
      Path fkConstraintsFile = new Path(constraintsRoot, ConstraintFileType.FOREIGNKEY.getPrefix() + tblName);
      SQLAllTableConstraints tableConstraints = hiveDb.getTableConstraints(dbName, tblName, tableId);
      if (CollectionUtils.isNotEmpty(tableConstraints.getPrimaryKeys())
          || CollectionUtils.isNotEmpty(tableConstraints.getUniqueConstraints())
          || CollectionUtils.isNotEmpty(tableConstraints.getNotNullConstraints())
          || CollectionUtils.isNotEmpty(tableConstraints.getCheckConstraints())
          || CollectionUtils.isNotEmpty(tableConstraints.getDefaultConstraints())) {
        try (JsonWriter jsonWriter = new JsonWriter(commonConstraintsFile.getFileSystem(conf), commonConstraintsFile)) {
          ConstraintsSerializer serializer = new ConstraintsSerializer(tableConstraints.getPrimaryKeys(), null,
              tableConstraints.getUniqueConstraints(), tableConstraints.getNotNullConstraints(),
              tableConstraints.getDefaultConstraints(), tableConstraints.getCheckConstraints(), conf);
          serializer.writeTo(jsonWriter, null);
        }
      }
      if (CollectionUtils.isNotEmpty(tableConstraints.getForeignKeys())) {
        try (JsonWriter jsonWriter = new JsonWriter(fkConstraintsFile.getFileSystem(conf), fkConstraintsFile)) {
          ConstraintsSerializer serializer =
              new ConstraintsSerializer(null, tableConstraints.getForeignKeys(), null, null, null, null, conf);
          serializer.writeTo(jsonWriter, null);
        }
      }
    } catch (NoSuchObjectException e) {
      // Bootstrap constraint dump shouldn't fail if the table is dropped/renamed while dumping it.
      // Just log a debug message and skip it.
      LOG.debug(e.getMessage());
    }
  }
Get if there is an entry for the txn id in the hive locks table. It can be in waiting state or acquired state.
@param txnId
@return true if the entry for the txn id is present in hive locks.
@throws LockException
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplDumpTask.java