private Predicate createInternalPredicate(Map<Resource.Type, String> mapResourceIds) {
    Resource.Type resourceType = getResourceDefinition().getType();
    Schema schema = clusterController.getSchema(resourceType);

    Set<Predicate> setPredicates = new HashSet<>();
    for (Map.Entry<Resource.Type, String> entry : mapResourceIds.entrySet()) {
      if (entry.getValue() != null) {
        String keyPropertyId = schema.getKeyPropertyId(entry.getKey());
        if (keyPropertyId != null) {
          setPredicates.add(new EqualsPredicate<>(keyPropertyId, entry.getValue()));
        }
      }
    }

    Predicate p = null;

    if (setPredicates.size() == 1) {
      p = setPredicates.iterator().next();
    } else if (setPredicates.size() > 1) {
      p = new AndPredicate(setPredicates.toArray(new Predicate[setPredicates.size()]));
    } else {
      return null;
    }

    Resource.Type type = getResourceDefinition().getType();
    Predicate override = clusterController.getAmendedPredicate(type, p);
    if (null != override) {
      p = override;
    }

    return p;
  }
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