Function<MMetastoreDBProperties, PropertyMap> getPropertyMapFunction(final Predicate<String> keyFilter, final Function<String, PropertySchema> getSchema) {
    return (mm) -> {
      final String key = mm.getPropertykey();
      if (keyFilter == null || keyFilter.test(key)) {
        final byte[] bytes = mm.getPropertyContent();
        if (bytes != null) {
          final PropertySchema schema = getSchema.apply(key);
          final PropertyMap map = deserialize(bytes, s->schema);
          // if read dirty - the schema version changed -, write back to make clean
          if (map.isDirty()) {
            saveProperties(key, map);
          }
          return map;
        }
      }
      return null;
    };
  }
Creates a function that transforms an MMetastoreDBProperties into a PropertyMap.
@param keyFilter a map key filtering predicate that will make the function return null if test fails
@param getSchema the function that solves a schema from a key
@return a function
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/JdoPropertyStore.java