@Transactional
  void loadExecutionCommandWrappers() {
    for (Map.Entry<String, Map<String, HostRoleCommand>> hostRoleCommandEntry : hostRoleCommands.entrySet()) {
      String hostname = hostRoleCommandEntry.getKey();
      List<ExecutionCommandWrapper> wrappers = new ArrayList<>();
      Map<String, HostRoleCommand> roleCommandMap = hostRoleCommandEntry.getValue();
      for (Map.Entry<String, HostRoleCommand> roleCommandEntry : roleCommandMap.entrySet()) {
        wrappers.add(roleCommandEntry.getValue().getExecutionCommandWrapper());
      }
      commandsToSend.put(hostname, wrappers);
    }
  }
Creates object to be persisted in database
@return StageEntity
ambari-server/src/main/java/org/apache/ambari/server/actionmanager/Stage.java