public TableConstraintsInfo getTableConstraints(String dbName, String tblName, boolean fetchReliable,
      boolean fetchEnabled, long tableId) throws HiveException {
    PerfLogger perfLogger = SessionState.getPerfLogger();
    perfLogger.perfLogBegin(CLASS_NAME, PerfLogger.HIVE_GET_TABLE_CONSTRAINTS);

    try {

      ValidWriteIdList validWriteIdList = getValidWriteIdList(dbName,tblName);
      AllTableConstraintsRequest request = new AllTableConstraintsRequest(dbName, tblName, getDefaultCatalog(conf));
      request.setValidWriteIdList(validWriteIdList != null ? validWriteIdList.writeToString() : null);
      request.setTableId(tableId);

      SQLAllTableConstraints tableConstraints = getMSC().getAllTableConstraints(request);
      if (fetchReliable && tableConstraints != null) {
        if (CollectionUtils.isNotEmpty(tableConstraints.getPrimaryKeys())) {
          tableConstraints.setPrimaryKeys(
              tableConstraints.getPrimaryKeys().stream().filter(SQLPrimaryKey::isRely_cstr)
                  .collect(Collectors.toList()));
        }
        if (CollectionUtils.isNotEmpty(tableConstraints.getForeignKeys())) {
          tableConstraints.setForeignKeys(
              tableConstraints.getForeignKeys().stream().filter(SQLForeignKey::isRely_cstr)
                  .collect(Collectors.toList()));
        }
        if (CollectionUtils.isNotEmpty(tableConstraints.getUniqueConstraints())) {
          tableConstraints.setUniqueConstraints(tableConstraints.getUniqueConstraints().stream()
              .filter(SQLUniqueConstraint::isRely_cstr).collect(Collectors.toList()));
        }
        if (CollectionUtils.isNotEmpty(tableConstraints.getNotNullConstraints())) {
          tableConstraints.setNotNullConstraints(tableConstraints.getNotNullConstraints().stream()
              .filter(SQLNotNullConstraint::isRely_cstr).collect(Collectors.toList()));
        }
      }

      if (fetchEnabled && tableConstraints != null) {
        if (CollectionUtils.isNotEmpty(tableConstraints.getCheckConstraints())) {
          tableConstraints.setCheckConstraints(
              tableConstraints.getCheckConstraints().stream().filter(SQLCheckConstraint::isEnable_cstr)
                  .collect(Collectors.toList()));
        }
        if (CollectionUtils.isNotEmpty(tableConstraints.getDefaultConstraints())) {
          tableConstraints.setDefaultConstraints(tableConstraints.getDefaultConstraints().stream()
              .filter(SQLDefaultConstraint::isEnable_cstr).collect(Collectors.toList()));
        }
      }
      return new TableConstraintsInfo(new PrimaryKeyInfo(tableConstraints.getPrimaryKeys(), tblName, dbName),
          new ForeignKeyInfo(tableConstraints.getForeignKeys(), tblName, dbName),
          new UniqueConstraint(tableConstraints.getUniqueConstraints(), tblName, dbName),
          new DefaultConstraint(tableConstraints.getDefaultConstraints(), tblName, dbName),
          new CheckConstraint(tableConstraints.getCheckConstraints()),
          new NotNullConstraint(tableConstraints.getNotNullConstraints(), tblName, dbName));
    } catch (Exception e) {
      throw new HiveException(e);
    } finally {
      perfLogger.perfLogEnd(CLASS_NAME, PerfLogger.HIVE_GET_TABLE_CONSTRAINTS, "HS2-cache");
    }
  }
Enqueue a compaction request.  Only 1 compaction for a given resource (db/table/partSpec) can
be scheduled/running at any given time.
@param request The {@link CompactionRequest} object containing the details required to enqueue
               a compaction request.
@throws HiveException
ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java