public void build(Stage stage) {
    if (stage == null) {
      throw new IllegalArgumentException("Null stage");
    }

    if (commandExecutionType == CommandExecutionType.DEPENDENCY_ORDERED) {
      LOG.info("Build stage with DEPENDENCY_ORDERED commandExecutionType: {} ",
          stage.getRequestContext());
    }

    initialStage = stage;

    Map<String, Map<String, HostRoleCommand>> hostRoleCommands = stage.getHostRoleCommands();
    build(hostRoleCommands);
  }
Given a stage builds a DAG of all execution commands within the stage.

@see #getStages()
ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraph.java