@Override
  public SQLAllTableConstraints createTableWithConstraints(Table tbl, SQLAllTableConstraints constraints)
      throws InvalidObjectException, MetaException {
    constraints = rawStore.createTableWithConstraints(tbl, constraints);
    // in case of event based cache update, cache is updated during commit.
    if (canUseEvents) {
      return constraints;
    }
    String dbName = normalizeIdentifier(tbl.getDbName());
    String tblName = normalizeIdentifier(tbl.getTableName());
    String catName = tbl.isSetCatName() ? normalizeIdentifier(tbl.getCatName()) : getDefaultCatalog(conf);
    if (!shouldCacheTable(catName, dbName, tblName)) {
      return constraints;
    }
    sharedCache.addTableToCache(catName, dbName, tblName, tbl);
    sharedCache.addTableConstraintsToCache(catName, dbName, tblName, constraints);
    return constraints;
  }
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