public MRTaskExecutionResponse.TaskGroupResponse groupTasksByValue(MRTaskExecutionResponse.TaskGroupResponse result, boolean keepShort, List<TaskExecutionAPIEntity> tasks, long value) { for (TaskExecutionAPIEntity entity : tasks) { String taskType = entity.getTags().get(MRJobTagName.TASK_TYPE.toString()); MRTaskExecutionResponse.TaskGroup taskGroup = result.tasksGroupByType.get(taskType.toUpperCase()); if (entity.getDuration() <= value && keepShort) { taskGroup.shortTasks.add(entity); } if (entity.getDuration() > value) { taskGroup.longTasks.add(entity); } } return result; }
public void taskExecutionEntityCreated(TaskExecutionAPIEntity taskExecutionAPIEntity) { JobCounters jobCounters = taskExecutionAPIEntity.getJobCounters(); if (jobCounters == null || jobCounters.getCounters() == null) { LOG.warn("found null job counters, task {}", taskExecutionAPIEntity.getTags().get(MRJobTagName.TASK_ID.toString())); return;
public MRJobTaskCountResponse.HistoryTaskCountResponse countHistoryTask(List<org.apache.eagle.jpm.mr.historyentity.TaskExecutionAPIEntity> tasks, long startTimeInMin, long endTimeInMin) { List<MRJobTaskCountResponse.UnitTaskCount> taskCounts = new ArrayList<>(); for (long i = startTimeInMin; i <= endTimeInMin; i++) { taskCounts.add(new MRJobTaskCountResponse.UnitTaskCount(i * DateTimeUtil.ONEMINUTE, null)); } for (org.apache.eagle.jpm.mr.historyentity.TaskExecutionAPIEntity task : tasks) { String taskType = task.getTags().get(MRJobTagName.TASK_TYPE.toString()); long taskStarTimeMin = task.getStartTime() / DateTimeUtil.ONEMINUTE; long taskEndTimeMin = task.getEndTime() / DateTimeUtil.ONEMINUTE; int relativeStartTime = (int) (taskStarTimeMin - startTimeInMin); int relativeEndTime = (int) (taskEndTimeMin - startTimeInMin); for (int i = relativeStartTime; i <= relativeEndTime; i++) { countTask(taskCounts.get(i), taskType); } } MRJobTaskCountResponse.HistoryTaskCountResponse response = new MRJobTaskCountResponse.HistoryTaskCountResponse(); response.taskCount = taskCounts; return response; }
int index = ResourceUtils.getDistributionPosition(times, o.getDuration() / DateTimeUtil.ONESECOND); MRJobTaskCountResponse.UnitTaskCount counter = finishedTaskCount.get(index); taskCountImpl.countTask(counter, o.getTags().get(TASK_TYPE.toString())); counter.entities.add(o);
if (task.getTags().get(TASK_TYPE.toString()).equalsIgnoreCase(Constants.TaskType.MAP.toString())) { totalMapTime += task.getDuration(); if (mapStartTime > task.getStartTime()) {