private static List<DataPoint> processLocalityData(List<TaskAttempt> taskAttempts, String taskType, String locality, Long[] xPoints, MinMax io) {
List<DataPoint> data = new ArrayList<DataPoint>();
int i = 0;
for (TaskAttempt taskAttempt : taskAttempts) {
if (taskType.equals(taskAttempt.getTaskType()) && locality.equals(taskAttempt.getLocality())) {
DataPoint point = new DataPoint();
point.setX(transformX(taskAttempt.getStartTime()));
point.setY(transformY(taskAttempt.getFinishTime() - taskAttempt.getStartTime()));
point.setIO(taskAttempt.getInputBytes() + taskAttempt.getOutputBytes());
point.setLabel(taskAttempt.getTaskAttemptId());
point.setStatus(taskAttempt.getStatus());
i = addDataPoint(data, point, i, xPoints);
io.max = Math.max(io.max, point.getIO());
io.min = Math.min(io.min, point.getIO());
}
}
while (i < xPoints.length)
data.add(new DataPoint(xPoints[i++]));
return data;
}