MAPREDUCE-6194. Bubble up final exception in failures during creation of output collectors. Contributed by Varun Saxena.
(cherry picked from commit 298d09c9b5
)
This commit is contained in:
parent
6465931c19
commit
a3fa1f0761
|
@ -8,6 +8,9 @@ Release 2.7.0 - UNRELEASED
|
||||||
|
|
||||||
IMPROVEMENTS
|
IMPROVEMENTS
|
||||||
|
|
||||||
|
MAPREDUCE-6194. Bubble up final exception in failures during creation
|
||||||
|
of output collectors (Varun Saxena via harsh)
|
||||||
|
|
||||||
MAPREDUCE-5420. Remove mapreduce.task.tmp.dir from mapred-default.xml
|
MAPREDUCE-5420. Remove mapreduce.task.tmp.dir from mapred-default.xml
|
||||||
(James Carman via harsh)
|
(James Carman via harsh)
|
||||||
|
|
||||||
|
|
|
@ -387,6 +387,7 @@ public class MapTask extends Task {
|
||||||
Class<?>[] collectorClasses = job.getClasses(
|
Class<?>[] collectorClasses = job.getClasses(
|
||||||
JobContext.MAP_OUTPUT_COLLECTOR_CLASS_ATTR, MapOutputBuffer.class);
|
JobContext.MAP_OUTPUT_COLLECTOR_CLASS_ATTR, MapOutputBuffer.class);
|
||||||
int remainingCollectors = collectorClasses.length;
|
int remainingCollectors = collectorClasses.length;
|
||||||
|
Exception lastException = null;
|
||||||
for (Class clazz : collectorClasses) {
|
for (Class clazz : collectorClasses) {
|
||||||
try {
|
try {
|
||||||
if (!MapOutputCollector.class.isAssignableFrom(clazz)) {
|
if (!MapOutputCollector.class.isAssignableFrom(clazz)) {
|
||||||
|
@ -406,10 +407,12 @@ public class MapTask extends Task {
|
||||||
if (--remainingCollectors > 0) {
|
if (--remainingCollectors > 0) {
|
||||||
msg += " (" + remainingCollectors + " more collector(s) to try)";
|
msg += " (" + remainingCollectors + " more collector(s) to try)";
|
||||||
}
|
}
|
||||||
|
lastException = e;
|
||||||
LOG.warn(msg, e);
|
LOG.warn(msg, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new IOException("Unable to initialize any output collector");
|
throw new IOException("Initialization of all the collectors failed. " +
|
||||||
|
"Error in last collector was :" + lastException.getMessage(), lastException);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
|
Loading…
Reference in New Issue