private static void addNonPoolNodes(PoolTreeNode root, Map<String, PoolTreeNode> poolMap,
        List<WMTrigger> unmanagedTriggers, Set<WMTrigger> unusedTriggers, Map<String, List<String>> unmanagedMappings,
        Map<String, List<String>> invalidMappings) {
      if (!unmanagedTriggers.isEmpty() || !unmanagedMappings.isEmpty()) {
        PoolTreeNode curr = createNonPoolNode(poolMap, "unmanaged queries", root);
        curr.triggers.addAll(unmanagedTriggers);
        curr.mappings.putAll(unmanagedMappings);
      }
      // TODO: perhaps we should also summarize the triggers pointing to invalid pools.
      if (!unusedTriggers.isEmpty()) {
        PoolTreeNode curr = createNonPoolNode(poolMap, "unused triggers", root);
        curr.triggers.addAll(unusedTriggers);
      }
      if (!invalidMappings.isEmpty()) {
        PoolTreeNode curr = createNonPoolNode(poolMap, "invalid mappings", root);
        curr.mappings.putAll(invalidMappings);
      }
    }
A n-ary tree for the pools, each node contains a pool and its children.
ql/src/java/org/apache/hadoop/hive/ql/ddl/workloadmanagement/resourceplan/show/formatter/ShowResourcePlanFormatter.java