public List<SQLForeignKey> getForeignKeys() {
      try {
        tableLock.readLock().lock();
        return new ArrayList<>(this.foreignKeyCache.values());
      } finally {
        tableLock.readLock().unlock();
      }
    }
Common method to cache constraints
@param constraintsList list of constraints to add to cache
@param fromPrewarm is this method called as part of prewarm phase
@param mn Constraint type
@return memory constraint is handled by cache eviction policy hence this method will always return true
if correct constraint type is provided.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/SharedCache.java