hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acmur...@apache.org
Subject svn commit: r957279 - in /hadoop/mapreduce/trunk: CHANGES.txt src/java/org/apache/hadoop/mapreduce/Job.java
Date Wed, 23 Jun 2010 17:37:43 GMT
Author: acmurthy
Date: Wed Jun 23 17:37:43 2010
New Revision: 957279

URL: http://svn.apache.org/viewvc?rev=957279&view=rev
Log:
MAPREDUCE-1868. Add a read and connection timeout to JobClient while pulling tasklogs. Contributed
by Krishna Ramachandran.

Modified:
    hadoop/mapreduce/trunk/CHANGES.txt
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/Job.java

Modified: hadoop/mapreduce/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/CHANGES.txt?rev=957279&r1=957278&r2=957279&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/CHANGES.txt (original)
+++ hadoop/mapreduce/trunk/CHANGES.txt Wed Jun 23 17:37:43 2010
@@ -60,6 +60,9 @@ Trunk (unreleased changes)
 
     MAPREDUCE-1851. Documents configuration parameters in streaming.
     (amareshwari)
+    
+    MAPREDUCE-1868. Add a read and connection timeout to JobClient while
+    pulling tasklogs. (Krishna Ramachandran via acmurthy)
 
   OPTIMIZATIONS
 

Modified: hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/Job.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/Job.java?rev=957279&r1=957278&r2=957279&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/Job.java (original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/Job.java Wed Jun 23 17:37:43
2010
@@ -107,6 +107,9 @@ public class Job extends JobContextImpl 
     "mapreduce.client.genericoptionsparser.used";
   public static final String SUBMIT_REPLICATION = 
     "mapreduce.client.submit.file.replication";
+  private static final String TASKLOG_PULL_TIMEOUT_KEY =
+           "mapreduce.client.tasklog.timeout";
+  private static final int DEFAULT_TASKLOG_TIMEOUT = 60000;
 
   @InterfaceStability.Evolving
   public static enum TaskStatusFilter { NONE, KILLED, FAILED, SUCCEEDED, ALL }
@@ -1227,7 +1230,11 @@ public class Job extends JobContextImpl 
   private void getTaskLogs(TaskAttemptID taskId, URL taskLogUrl, 
                            OutputStream out) {
     try {
+      int tasklogtimeout = cluster.getConf().getInt(
+        TASKLOG_PULL_TIMEOUT_KEY, DEFAULT_TASKLOG_TIMEOUT);
       URLConnection connection = taskLogUrl.openConnection();
+      connection.setReadTimeout(tasklogtimeout);
+      connection.setConnectTimeout(tasklogtimeout);
       BufferedReader input = 
         new BufferedReader(new InputStreamReader(connection.getInputStream()));
       BufferedWriter output = 



Mime
View raw message