@Override
  public List<SQLForeignKey> addForeignKeys(List<SQLForeignKey> fks) throws InvalidObjectException, MetaException {
    fks = rawStore.addForeignKeys(fks);
    if (!canUseEvents && fks != null && !fks.isEmpty()) {
      String catName = normalizeIdentifier(fks.get(0).getCatName());
      String dbName = normalizeIdentifier(fks.get(0).getFktable_db());
      String tblName = normalizeIdentifier(fks.get(0).getFktable_db());
      if (!shouldCacheTable(catName, dbName, tblName)) {
        return fks;
      }
      sharedCache.addForeignKeysToCache(catName, dbName, tblName, fks);
    }
    return fks;
  }
Method to fetch all table constraints at once
@param catName catalog name
@param dbName database name
@param tblName table name
@return list of all table constraints
@throws MetaException
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/CachedStore.java