private void processEvents(List<Event> events) {
    long appFinishedTime = 0;
    for (Event event : events) {
      if (event.getType().equals(EventType.TASK_STARTED)) {
        TaskStarted taskStartedEvent = (TaskStarted) event.getEvent();
        String taskType = taskStartedEvent.getTaskType();
        int taskIndex = taskStartedEvent.getTaskIndex();
        initTaskMap(taskType, taskIndex);
        _taskMap.get(taskType).get(taskIndex).setTaskStartTime(event.getTimestamp());
      } else if (event.getType().equals(EventType.TASK_FINISHED)) {
        TaskFinished taskFinishedEvent = (TaskFinished) event.getEvent();
        String taskType = taskFinishedEvent.getTaskType();
        int taskIndex = taskFinishedEvent.getTaskIndex();
        initTaskMap(taskType, taskIndex);
        _taskMap.get(taskType).get(taskIndex).setTaskEndTime(event.getTimestamp());
        _taskMap.get(taskType).get(taskIndex).setMetrics(taskFinishedEvent.getMetrics());
      } else if (event.getType().equals(EventType.APPLICATION_FINISHED)) {
        appFinishedTime = event.getTimestamp();
      }
    }

    // Set end time for any tasks that don't have end times to application finish time
    if (appFinishedTime > 0) {
      for (Map<Integer, TonyTaskData> taskDataMap : _taskMap.values()) {
        for (TonyTaskData taskData : taskDataMap.values()) {
          if (taskData.getTaskEndTime() == 0) {
            taskData.setTaskEndTime(appFinishedTime);
          }
        }
      }
    }
  }
Returns a map of task data.
@return  a map from task type to a map of task index to task data
app/com/linkedin/drelephant/tony/data/TonyApplicationData.java