private StageWrapper getServerActionStageWrapper(UpgradeContext ctx, ExecuteStage execution) {

    String service   = execution.service;
    String component = execution.component;
    Task task        = execution.task;

    Set<String> realHosts = Collections.emptySet();

    if (StringUtils.isNotEmpty(service) && StringUtils.isNotEmpty(component)) {
      HostsType hosts = ctx.getResolver().getMasterAndHosts(service, component);

      if (null == hosts || hosts.getHosts().isEmpty()) {
        return null;
      } else {
        realHosts = new LinkedHashSet<>(hosts.getHosts());
      }
    }

    if (Task.Type.MANUAL == task.getType()) {
      return new StageWrapper(
          StageWrapper.Type.SERVER_SIDE_ACTION,
          execution.title,
          new TaskWrapper(service, component, realHosts, task));
    } else {
      return new StageWrapper(
          StageWrapper.Type.SERVER_SIDE_ACTION,
          execution.title,
          new TaskWrapper(null, null, Collections.emptySet(), task));
    }
  }
Return a Stage Wrapper for a server side action that runs on the server.
@param ctx Upgrade Context
@param execution Execution Stage
@return Returns a Stage Wrapper
ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/ClusterGrouping.java