Program: 130263
Project: 130263
Buggy source:
/** 
 * This method is responsible for populating the reduce phase details.
 * @return TaskOutputDetails contains the details of the reduce phase.
 */
private TaskOutputDetails addReducePhaseDetails(Entry<TaskAttemptID,TaskAttemptInfo> task,long referencedZeroTime){
  TaskAttemptInfo taskAttemptInfo=(TaskAttemptInfo)(task.getValue());
  TaskOutputDetails taskOutputDetails=new TaskOutputDetails();
  taskOutputDetails.setTaskStatus(taskAttemptInfo.getTaskStatus());
  taskOutputDetails.setTaskType(taskAttemptInfo.getTaskType().toString());
  taskOutputDetails.setTaskID(taskAttemptInfo.getAttemptId().getTaskID().toString());
  taskOutputDetails.setLocation(taskAttemptInfo.getHostname());
  Counters counters=taskAttemptInfo.getCounters();
  CounterGroup mapReduceTaskCounters=counters.getGroup("String_Node_Str");
  Counter reduceOutputRecords=mapReduceTaskCounters.findCounter("String_Node_Str");
  taskOutputDetails.setOutputRecords(reduceOutputRecords.getValue());
  Counter reduceOutputBytes=mapReduceTaskCounters.findCounter("String_Node_Str");
  taskOutputDetails.setOutputBytes(reduceOutputBytes.getValue());
  long shuffleStartTime=(taskAttemptInfo.getStartTime() - referencedZeroTime) / CONVERSION_FACTOR_MILLISECS_TO_SECS;
  taskOutputDetails.setStartPoint(shuffleStartTime);
  taskOutputDetails.setShuffleStart(shuffleStartTime);
  LOGGER.info("String_Node_Str" + taskOutputDetails.getShuffleStart());
  long shuffleEnd=((taskAttemptInfo.getShuffleFinishTime() - referencedZeroTime) / CONVERSION_FACTOR_MILLISECS_TO_SECS);
  taskOutputDetails.setShuffleEnd(shuffleEnd);
  LOGGER.info("String_Node_Str" + taskOutputDetails.getShuffleEnd());
  taskOutputDetails.setSortStart(shuffleEnd);
  long sortEnd=(taskAttemptInfo.getSortFinishTime() - referencedZeroTime) / CONVERSION_FACTOR_MILLISECS_TO_SECS;
  taskOutputDetails.setSortEnd(sortEnd);
  LOGGER.info("String_Node_Str" + taskOutputDetails.getSortEnd());
  taskOutputDetails.setReduceStart(sortEnd);
  taskOutputDetails.setReduceEnd((taskAttemptInfo.getFinishTime() - referencedZeroTime) / CONVERSION_FACTOR_MILLISECS_TO_SECS);
  taskOutputDetails.setEndPoint(taskOutputDetails.getReduceEnd());
  LOGGER.info("String_Node_Str" + taskOutputDetails.getReduceEnd());
  long dataFlowRate=reduceOutputBytes.getValue() / (taskOutputDetails.getReduceEnd() - shuffleStartTime);
  taskOutputDetails.setDataFlowRate(dataFlowRate);
  Counter physicalMemoryBytes=mapReduceTaskCounters.findCounter("String_Node_Str");
  ResourceUsageMetrics rum=new ResourceUsageMetrics();
  rum.setPhysicalMemoryUsage(physicalMemoryBytes.getValue());
  taskOutputDetails.setResourceUsageMetrics(rum);
  return taskOutputDetails;
}

Fixed version (ground truth):
/** 
 * This method is responsible for populating the reduce phase details.
 * @return TaskOutputDetails contains the details of the reduce phase.
 */
private TaskOutputDetails addReducePhaseDetails(Entry<TaskAttemptID,TaskAttemptInfo> task,long referencedZeroTime){
  TaskAttemptInfo taskAttemptInfo=(TaskAttemptInfo)(task.getValue());
  TaskOutputDetails taskOutputDetails=new TaskOutputDetails();
  taskOutputDetails.setTaskStatus(taskAttemptInfo.getTaskStatus());
  taskOutputDetails.setTaskType(taskAttemptInfo.getTaskType().toString());
  taskOutputDetails.setTaskID(taskAttemptInfo.getAttemptId().getTaskID().toString());
  taskOutputDetails.setLocation(taskAttemptInfo.getHostname());
  Counters counters=taskAttemptInfo.getCounters();
  CounterGroup mapReduceTaskCounters=counters.getGroup("String_Node_Str");
  Counter reduceOutputRecords=mapReduceTaskCounters.findCounter("String_Node_Str");
  taskOutputDetails.setOutputRecords(reduceOutputRecords.getValue());
  Counter reduceOutputBytes=mapReduceTaskCounters.findCounter("String_Node_Str");
  taskOutputDetails.setOutputBytes(reduceOutputBytes.getValue());
  long shuffleStartTime=(taskAttemptInfo.getStartTime() - referencedZeroTime) / CONVERSION_FACTOR_MILLISECS_TO_SECS;
  taskOutputDetails.setStartPoint(shuffleStartTime);
  taskOutputDetails.setShuffleStart(shuffleStartTime);
  long shuffleEnd=((taskAttemptInfo.getShuffleFinishTime() - referencedZeroTime) / CONVERSION_FACTOR_MILLISECS_TO_SECS);
  taskOutputDetails.setShuffleEnd(shuffleEnd);
  taskOutputDetails.setSortStart(shuffleEnd);
  long sortEnd=(taskAttemptInfo.getSortFinishTime() - referencedZeroTime) / CONVERSION_FACTOR_MILLISECS_TO_SECS;
  taskOutputDetails.setSortEnd(sortEnd);
  taskOutputDetails.setReduceStart(sortEnd);
  taskOutputDetails.setReduceEnd((taskAttemptInfo.getFinishTime() - referencedZeroTime) / CONVERSION_FACTOR_MILLISECS_TO_SECS);
  taskOutputDetails.setEndPoint(taskOutputDetails.getReduceEnd());
  long dataFlowRate=reduceOutputBytes.getValue() / (taskOutputDetails.getReduceEnd() - shuffleStartTime);
  taskOutputDetails.setDataFlowRate(dataFlowRate);
  Counter physicalMemoryBytes=mapReduceTaskCounters.findCounter("String_Node_Str");
  ResourceUsageMetrics rum=new ResourceUsageMetrics();
  rum.setPhysicalMemoryUsage(physicalMemoryBytes.getValue());
  taskOutputDetails.setResourceUsageMetrics(rum);
  return taskOutputDetails;
}