@Override
  public Map<String, PropertyMap> selectProperties(final String keyPrefix, Predicate<String> keyFilter, Function<String, PropertySchema> getSchema) {
    final Map<String, PropertyMap> results = new TreeMap<>();
    // go select the digests for the maps we seek
    final Map<String, UUID> digests = store.selectDigest(keyPrefix, keyFilter);
    final Iterator<Map.Entry<String, UUID>> idigest = digests.entrySet().iterator();
    while (idigest.hasNext()) {
      Map.Entry<String, UUID> entry = idigest.next();
      String key = entry.getKey();
      PropertyMap map = maps.get(key);
      // remove from maps to select and add to results if in the cache and digest is valid
      if (map != null && Objects.equals(map.getDigest(), entry.getValue())) {
        results.put(key, map.copy());
        idigest.remove();
      }
    }
    // digests now contains the names of maps required that are not results
    Map<String, PropertyMap> selectedMaps = store.selectProperties(keyPrefix, digests::containsKey, getSchema);
    // we cache those new maps and for each add the copy to the result if we have not loaded and cached it concurrently
    selectedMaps.forEach((k, v) -> {
      PropertyMap m = maps.putIfAbsent(k, v);
      results.put(k, m != null && m.isDirty()? m : v.copy());
    });
    return results;
  }
A property map store using a pull-thru cache.
<p>
Before a map is returned, a check against the stored corresponding digest is performed to avoid
using stale data.
</p>
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/properties/CachingPropertyStore.java