public void addTableConstraintsToCache(String catName, String dbName, String tblName, SQLAllTableConstraints constraints){
    try {
      cacheLock.readLock().lock();
      String tblKey = CacheUtils.buildTableKey(catName, dbName, tblName);
      TableWrapper tblWrapper = tableCache.getIfPresent(tblKey);
      if (tblWrapper != null) {
        tblWrapper.cacheConstraints(constraints, false);
      }
    } finally {
      cacheLock.readLock().unlock();
    }
  }
Replaces the old db object with the new one. This will add the new database to cache if it does
not exist.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/SharedCache.java