@Override
  public List<SQLNotNullConstraint> addNotNullConstraints(List<SQLNotNullConstraint> nns)
      throws InvalidObjectException, MetaException {
    nns = rawStore.addNotNullConstraints(nns);
    // in case of event based cache update, cache will be updated during commit.
    if (!canUseEvents && CollectionUtils.isNotEmpty(nns)) {
      String catName = normalizeIdentifier(nns.get(0).getCatName());
      String dbName = normalizeIdentifier(nns.get(0).getTable_db());
      String tblName = normalizeIdentifier(nns.get(0).getTable_name());
      if (!shouldCacheTable(catName, dbName, tblName)) {
        return nns;
      }
      sharedCache.addNotNullConstraintsToCache(catName, dbName, tblName, nns);
    }
    return nns;
  }
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