|
@@ -1134,6 +1134,8 @@ class ReduceTask extends Task {
|
|
|
private final static int UNIT_CONNECT_TIMEOUT = 30 * 1000;
|
|
|
// default read timeout (in milliseconds)
|
|
|
private final static int DEFAULT_READ_TIMEOUT = 3 * 60 * 1000;
|
|
|
+ private final int shuffleConnectionTimeout;
|
|
|
+ private final int shuffleReadTimeout;
|
|
|
|
|
|
private MapOutputLocation currentLocation = null;
|
|
|
private int id = nextMapOutputCopierId++;
|
|
@@ -1149,6 +1151,11 @@ class ReduceTask extends Task {
|
|
|
LOG.debug(getName() + " created");
|
|
|
this.reporter = reporter;
|
|
|
|
|
|
+ shuffleConnectionTimeout =
|
|
|
+ job.getInt("mapreduce.reduce.shuffle.connect.timeout", STALLED_COPY_TIMEOUT);
|
|
|
+ shuffleReadTimeout =
|
|
|
+ job.getInt("mapreduce.reduce.shuffle.read.timeout", DEFAULT_READ_TIMEOUT);
|
|
|
+
|
|
|
if (job.getCompressMapOutput()) {
|
|
|
Class<? extends CompressionCodec> codecClass =
|
|
|
job.getMapOutputCompressorClass(DefaultCodec.class);
|
|
@@ -1370,8 +1377,8 @@ class ReduceTask extends Task {
|
|
|
// Connect
|
|
|
URLConnection connection =
|
|
|
mapOutputLoc.getOutputLocation().openConnection();
|
|
|
- InputStream input = getInputStream(connection, STALLED_COPY_TIMEOUT,
|
|
|
- DEFAULT_READ_TIMEOUT);
|
|
|
+ InputStream input = getInputStream(connection, shuffleConnectionTimeout,
|
|
|
+ shuffleReadTimeout);
|
|
|
|
|
|
// Validate header from map output
|
|
|
TaskAttemptID mapId = null;
|
|
@@ -1510,8 +1517,8 @@ class ReduceTask extends Task {
|
|
|
// Reconnect
|
|
|
try {
|
|
|
connection = mapOutputLoc.getOutputLocation().openConnection();
|
|
|
- input = getInputStream(connection, STALLED_COPY_TIMEOUT,
|
|
|
- DEFAULT_READ_TIMEOUT);
|
|
|
+ input = getInputStream(connection, shuffleConnectionTimeout,
|
|
|
+ shuffleReadTimeout);
|
|
|
} catch (IOException ioe) {
|
|
|
LOG.info("Failed reopen connection to fetch map-output from " +
|
|
|
mapOutputLoc.getHost());
|