private static Map<Resource.InternalType, Map<Resource.Type, String>> readKeyPropertyIds(String filename) {
    ObjectMapper mapper = new ObjectMapper();

    try {
      Map<Resource.InternalType, Map<Resource.InternalType, String>> map =
          mapper.readValue(ClassLoader.getSystemResourceAsStream(filename),
              new TypeReference<Map<Resource.InternalType, Map<Resource.InternalType, String>>>() {});

      Map<Resource.InternalType, Map<Resource.Type, String>> returnMap =
        new HashMap<>();

      // convert inner maps from InternalType to Type
      for (Map.Entry<Resource.InternalType, Map<Resource.InternalType, String>> entry : map.entrySet()) {
        Map<Resource.Type, String> innerMap = new HashMap<>();

        for (Map.Entry<Resource.InternalType, String> entry1 : entry.getValue().entrySet()) {
          innerMap.put(Resource.Type.valueOf(entry1.getKey().name()), entry1.getValue());
        }
        returnMap.put(entry.getKey(), innerMap);
      }
      return returnMap;
    } catch (IOException e) {
      throw new IllegalStateException("Can't read properties file " + filename, e);
    }
  }
Factory method to create an update request from the given map of properties.
The properties values in the given map are used to update the resource.

@param properties             resource properties associated with the request; may be null
@param requestInfoProperties  request specific properties; may be null
ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/PropertyHelper.java