private void updateDatabases(RawStore rawStore, String catName, List<String> dbNames) {
      LOG.debug("CachedStore: updating cached database objects for catalog: {}", catName);
      boolean success = false;
      // Try MAX_RETRIES times, then move to next method
      int maxTries = MAX_RETRIES;
      while (!success && (maxTries-- > 0)) {
        // Prepare the list of databases
        List<Database> databases = new ArrayList<>();
        for (String dbName : dbNames) {
          Database db;
          try {
            db = rawStore.getDatabase(catName, dbName);
            databases.add(db);
          } catch (NoSuchObjectException e) {
            LOG.info("Updating CachedStore: database: " + catName + "." + dbName + " does not exist.", e);
          }
        }
        success = sharedCache.refreshDatabasesInCache(databases);
        LOG.debug("CachedStore: updated cached database objects for catalog: {}", catName);
      }
    }
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