boolean cacheConstraints(SQLAllTableConstraints constraints, boolean fromPrewarm) {
      try {
        tableLock.writeLock().lock();
        this.isConstraintsValid =
            cacheConstraints(constraints.getPrimaryKeys(), fromPrewarm, MemberName.PRIMARY_KEY_CACHE) && cacheConstraints(
                constraints.getForeignKeys(), fromPrewarm, MemberName.FOREIGN_KEY_CACHE) && cacheConstraints(
                constraints.getDefaultConstraints(), fromPrewarm, MemberName.DEFAULT_CONSTRAINT_CACHE)
                && cacheConstraints(constraints.getUniqueConstraints(), fromPrewarm, MemberName.UNIQUE_CONSTRAINT_CACHE)
                && cacheConstraints(constraints.getNotNullConstraints(), fromPrewarm, MemberName.NOTNULL_CONSTRAINT_CACHE)
                && cacheConstraints(constraints.getCheckConstraints(), fromPrewarm, MemberName.CHECK_CONSTRAINT_CACHE);
        tableToUpdateSize.add(getTblKey());
        return this.isConstraintsValid;
      } finally {
        tableLock.writeLock().unlock();
      }

    }
this flag is used to validate/invalidate cached constraints snapshot.
All table constraints are update successfully either via updater thread or
while create_table_with_constraint api then it is set to true else
false and redirect all the call to raw metastore.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/SharedCache.java