public List<String> listCachedDatabases(String catName) {
    List<String> results = new ArrayList<>();
    try {
      cacheLock.readLock().lock();
      for (String pair : databaseCache.keySet()) {
        String[] n = CacheUtils.splitDbName(pair);
        if (catName.equals(n[0])) {
          results.add(n[1]);
        }
      }
    } finally {
      cacheLock.readLock().unlock();
    }
    return results;
  }
Common method to refresh cache constraint
@param constraints list of constraints to update
@param mn Constraint type
@return Since memory constraint is handled by cache eviction policy.
Hence this method will always return true if correct constraint type passed.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/SharedCache.java