private void mergeFinalizedProperties(TreeNode<Set<String>> node, QueryImpl query) {

    Set<String> finalizedProperties = node.getObject();
    query.requestedProperties.clear();
    // currently not exposing temporal information to renderer
    query.requestedProperties.addAll(finalizedProperties);

    for (TreeNode<Set<String>> child : node.getChildren()) {
      Resource.Type childType = Resource.Type.valueOf(child.getName());
      ResourceDefinition parentResource = query.resourceDefinition;
      Set<SubResourceDefinition> subResources = parentResource.getSubResourceDefinitions();
      String subResourceName = null;
      for (SubResourceDefinition subResource : subResources) {
        if (subResource.getType() == childType) {
          ResourceDefinition resource = ResourceInstanceFactoryImpl.getResourceDefinition(
              subResource.getType(), query.keyValueMap);
          subResourceName = getSubResourceName(resource, subResource);
          break;
        }
      }
      QueryImpl subQuery = query.requestedSubResources.get(subResourceName);
      if (subQuery == null) {
        query.addProperty(subResourceName, null);
        subQuery = query.requestedSubResources.get(subResourceName);
      }
      mergeFinalizedProperties(child, subQuery);
    }
  }
Merge the tree of query properties returned by the renderer with properties in
the query tree.

@param node   property tree node
@param query  query associated with the property tree node
ambari-server/src/main/java/org/apache/ambari/server/api/query/QueryImpl.java