@Subscribe
  public void onTaskCreateEvent(TaskCreateEvent event) {
    LOG.debug("Received task create event {}", event);
    List<HostRoleCommand> hostRoleCommandListAll = event.getHostRoleCommands();

    for (HostRoleCommand hostRoleCommand : hostRoleCommandListAll) {
      activeTasksMap.put(hostRoleCommand.getTaskId(), hostRoleCommand);
      addStagePK(hostRoleCommand);
      addRequestId(hostRoleCommand);
    }
  }
On receiving task create event, create entries in the running request, stage and task in the maps
@param event Consumes {@link TaskCreateEvent}.
ambari-server/src/main/java/org/apache/ambari/server/events/listeners/tasks/TaskStatusListener.java