public static CalculatedStatus statusFromTaskEntities(Collection<HostRoleCommandEntity> tasks, boolean skippable) {

    int size = tasks.size();

    Map<HostRoleStatus, Integer> taskStatusCounts = CalculatedStatus.calculateTaskEntityStatusCounts(tasks);

    HostRoleStatus status = calculateSummaryStatus(taskStatusCounts, size, skippable);

    double progressPercent = calculateProgressPercent(taskStatusCounts, size);

    return new CalculatedStatus(status, progressPercent);
  }
Factory method to create a calculated status.  Calculate request status from the given
collection of task entities.

@param tasks      the collection of task entities
@param skippable  true if a single failed status should NOT result in an overall failed status

@return a calculated status
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java