throws IOException {
boolean needCommit = false;
if(context.getTaskAttemptID().isMap()) {
for (Pair<OutputCommitter, POStore> mapCommitter :
mapOutputCommitters) {
TaskAttemptContext updatedContext = setUpContext(context,
mapCommitter.second);
needCommit = needCommit ||
mapCommitter.first.needsTaskCommit(updatedContext);
}
return needCommit;
} else {
for (Pair<OutputCommitter, POStore> reduceCommitter :
reduceOutputCommitters) {
TaskAttemptContext updatedContext = setUpContext(context,
reduceCommitter.second);
needCommit = needCommit ||
reduceCommitter.first.needsTaskCommit(updatedContext);
}
return needCommit;