@Override public Partition getPartition(String catName, String dbName, String tblName, List<String> partVals,
      String validWriteIds) throws MetaException, NoSuchObjectException {
    catName = normalizeIdentifier(catName);
    dbName = StringUtils.normalizeIdentifier(dbName);
    tblName = StringUtils.normalizeIdentifier(tblName);
    if (!shouldCacheTable(catName, dbName, tblName) || (canUseEvents && rawStore.isActiveTransaction())) {
      return rawStore.getPartition(catName, dbName, tblName, partVals, validWriteIds);
    }
    Partition part = sharedCache.getPartitionFromCache(catName, dbName, tblName, partVals);
    if (part == null) {
      // The table containing the partition is not yet loaded in cache
      return rawStore.getPartition(catName, dbName, tblName, partVals, validWriteIds);
    }
    if (validWriteIds != null) {
      Table table = sharedCache.getTableFromCache(catName, dbName, tblName);
      if (table == null) {
        // The table containing the partition is not yet loaded in cache
        return rawStore.getPartition(catName, dbName, tblName, partVals, validWriteIds);
      }
      part.setParameters(
          adjustStatsParamsForGet(table.getParameters(), part.getParameters(), part.getWriteId(), validWriteIds));
    }

    return part;
  }
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