protected void ensureRequiredProperties(
      TreeNode<Set<String>> propertyTree, boolean addIfEmpty) {

    Resource.Type type = Resource.Type.valueOf(propertyTree.getName());
    Set<String> properties = propertyTree.getObject();

    if (!properties.isEmpty() || addIfEmpty) {
      addKeys(type, properties);
    }

    for (TreeNode<Set<String>> child : propertyTree.getChildren()) {
      ensureRequiredProperties(child, addIfEmpty);
    }
  }
Add required primary and foreign keys properties based on request type.

@param propertyTree  tree of properties
@param addIfEmpty    whether keys should be added to node with no properties
ambari-server/src/main/java/org/apache/ambari/server/api/query/render/BaseRenderer.java