hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r1077510 - /hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobClient.java
Date Fri, 04 Mar 2011 04:22:13 GMT
Author: omalley
Date: Fri Mar  4 04:22:12 2011
New Revision: 1077510

URL: http://svn.apache.org/viewvc?rev=1077510&view=rev
Log:
commit 73c173f7b9374a6423c950ce41cf277518e1459c
Author: Arun C Murthy <acmurthy@apache.org>
Date:   Wed Jun 23 09:37:40 2010 -0700

    MAPREDUCE-1868. Add a read and connection timeout to JobClient while pulling tasklogs.
Contributed by Krishna Ramachandran.
    
    +++ b/YAHOO-CHANGES.txt
    +    MAPREDUCE-1868. Add a read and connection timeout to JobClient while
    +    pulling tasklogs. (Krishna Ramachandran via acmurthy)
    +

Modified:
    hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobClient.java

Modified: hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobClient.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobClient.java?rev=1077510&r1=1077509&r2=1077510&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobClient.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobClient.java
Fri Mar  4 04:22:12 2011
@@ -405,6 +405,10 @@ public class JobClient extends Configure
   
   private FileSystem fs = null;
   private UserGroupInformation ugi;
+  private static final String TASKLOG_PULL_TIMEOUT_KEY = 
+    "mapreduce.client.tasklog.timeout";
+  private static final int DEFAULT_TASKLOG_TIMEOUT = 60000;
+  static int tasklogtimeout;
 
   /**
    * Create a job client.
@@ -431,6 +435,8 @@ public class JobClient extends Configure
    */
   public void init(JobConf conf) throws IOException {
     String tracker = conf.get("mapred.job.tracker", "local");
+    tasklogtimeout = conf.getInt(
+      TASKLOG_PULL_TIMEOUT_KEY, DEFAULT_TASKLOG_TIMEOUT);
     this.ugi = UserGroupInformation.getCurrentUser();
     if ("local".equals(tracker)) {
       conf.setNumMapTasks(1);
@@ -1283,6 +1289,8 @@ public class JobClient extends Configure
                                   OutputStream out) {
     try {
       URLConnection connection = taskLogUrl.openConnection();
+      connection.setReadTimeout(tasklogtimeout);
+      connection.setConnectTimeout(tasklogtimeout);
       BufferedReader input = 
         new BufferedReader(new InputStreamReader(connection.getInputStream()));
       BufferedWriter output = 



Mime
View raw message