public Collection<StageEntity> getStageEntities() {
    Collection<StageEntity> stages = new ArrayList<>();
    for (HostRequest hostRequest : allHostRequests) {
      StageEntity stage = new StageEntity();
      stage.setStageId(hostRequest.getStageId());
      stage.setRequestContext(getRequestContext());
      stage.setRequestId(getRequestId());
      //todo: not sure what this byte array is???
      //stage.setClusterHostInfo();
      stage.setClusterId(getClusterId());
      boolean skipFailure = hostRequest.shouldSkipFailure();
      stage.setSkippable(skipFailure);
      stage.setAutoSkipFailureSupported(skipFailure);
      // getTaskEntities() sync's state with physical tasks
      stage.setHostRoleCommands(hostRequest.getTaskEntities());

      stages.add(stage);
    }
    return stages;
  }
Removes pending host requests (outstanding requests not picked up by any host, where hostName is null) for a host group.
@param hostGroupName
@return
ambari-server/src/main/java/org/apache/ambari/server/topology/LogicalRequest.java