hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m.@apache.org
Subject svn commit: r377801 - in /lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred: JobInProgress.java TaskInProgress.java
Date Tue, 14 Feb 2006 18:53:31 GMT
Author: mc
Date: Tue Feb 14 10:53:29 2006
New Revision: 377801

URL: http://svn.apache.org/viewcvs?rev=377801&view=rev
Log:

  Fix bug HADOOP-16.

  Don't invoke TaskInProgress.hasTaskWithCacheHit() 
unnecessarily from within JobInProgress.

  Also, cache filesystem hints inside JobInProgress.


Modified:
    lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobInProgress.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskInProgress.java

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobInProgress.java
URL: http://svn.apache.org/viewcvs/lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobInProgress.java?rev=377801&r1=377800&r2=377801&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobInProgress.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobInProgress.java Tue Feb 14 10:53:29
2006
@@ -275,10 +275,12 @@
             if (maps[i].hasTaskWithCacheHit(taskTracker, tts)) {
                 if (cacheTarget < 0) {
                     cacheTarget = i;
+                    break;
                 }
             } else if (maps[i].hasTask()) {
                 if (stdTarget < 0) {
                     stdTarget = i;
+                    break;
                 }
             }
             totalProgress += maps[i].getProgress();

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskInProgress.java
URL: http://svn.apache.org/viewcvs/lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskInProgress.java?rev=377801&r1=377800&r2=377801&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskInProgress.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskInProgress.java Tue Feb 14 10:53:29
2006
@@ -49,6 +49,7 @@
     // Defines the TIP
     String jobFile = null;
     FileSplit split = null;
+    String hints[][] = null;
     TaskInProgress predecessors[] = null;
     int partition;
     JobTracker jobtracker;
@@ -360,12 +361,16 @@
         } else {
             try {
                 if (isMapTask()) {
-                    FileSystem fs = FileSystem.get(conf);
-                    String hints[][] = fs.getFileCacheHints(split.getFile(), split.getStart(),
split.getLength());
-                    for (int i = 0; i < hints.length; i++) {
-                        for (int j = 0; j < hints[i].length; j++) {
-                            if (hints[i][j].equals(tts.getHost())) {
-                                return true;
+                    if (hints == null) {
+                        FileSystem fs = FileSystem.get(conf);
+                        hints = fs.getFileCacheHints(split.getFile(), split.getStart(), split.getLength());
+                    }
+                    if (hints != null) {
+                        for (int i = 0; i < hints.length; i++) {
+                            for (int j = 0; j < hints[i].length; j++) {
+                                if (hints[i][j].equals(tts.getHost())) {
+                                    return true;
+                                }
                             }
                         }
                     }



Mime
View raw message