@Override
  public List<Database> getDatabaseObjects(String catName, String pattern) throws MetaException {
    if (!sharedCache.isDatabaseCachePrewarmed() || (canUseEvents && rawStore.isActiveTransaction())) {
      return rawStore.getDatabaseObjects(catName, pattern);
    }

    List<String> dbNames;
    if (pattern == null || pattern.equals("*")) {
      dbNames = sharedCache.listCachedDatabases(catName);
    } else {
      dbNames = sharedCache.listCachedDatabases(catName, pattern);
    }

    List<Database> databases = new ArrayList<>(dbNames.size());
    for (String dbName : dbNames) {
      Database db = sharedCache.getDatabaseFromCache(catName, dbName);
      if (db != null) {
        databases.add(db);
      }
    }
    return databases;
  }
This starts a background thread, which initially populates the SharedCache and later
periodically gets updates from the metastore db

@param conf
@param runOnlyOnce
@param shouldRunPrewarm
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/CachedStore.java