public void convertQueueHierarchy(FSQueue queue) {
    List<FSQueue> children = queue.getChildQueues();
    final String queueName = queue.getName();

    emitChildQueues(queueName, children);
    emitMaxAMShare(queueName, queue);
    emitMaxParallelApps(queueName, queue);
    emitMaxAllocations(queueName, queue);
    emitPreemptionDisabled(queueName, queue);

    emitChildCapacity(queue);
    emitMaximumCapacity(queueName, queue);
    emitSizeBasedWeight(queueName);
    emitOrderingPolicy(queueName, queue);
    checkMaxChildCapacitySetting(queue);
    emitDefaultUserLimitFactor(queueName, children);

    for (FSQueue childQueue : children) {
      convertQueueHierarchy(childQueue);
    }
  }
@Test
  public void testQueueMaxAllocations() {
    converter = builder.build();

    converter.convertQueueHierarchy(rootQueue);

    // root.admins vcores + mb
    assertEquals("root.admins max vcores", 3,
        csConfig.getQueueMaximumAllocationVcores(ADMINS));
    assertEquals("root.admins max memory", 4096,
        csConfig.getQueueMaximumAllocationMb(ADMINS));

    // root.users.john max vcores + mb
    assertEquals("root.users.john max vcores", 2,
        csConfig.getQueueMaximumAllocationVcores(USERS_JOHN));
    assertEquals("root.users.john max memory", 8192,
        csConfig.getQueueMaximumAllocationMb(USERS_JOHN));

    Set<String> remaining = Sets.difference(ALL_QUEUES,
        Sets.newHashSet("root.admins", "root.users.john"));

    for (String queue : remaining) {
      key = PREFIX + queue + ".maximum-allocation-vcores";
      assertEquals("Key " + key + " has different value",
          -1.0, csConfig
              .getQueueMaximumAllocationVcores(new QueuePath(queue)), 0.0f);

      key = PREFIX + queue + ".maximum-allocation-mb";
      assertEquals("Key " + key + " has different value",
          -1.0, csConfig
              .getQueueMaximumAllocationMb(new QueuePath(queue)), 0.0f);
    }
  }