Ver Fonte

commit 5511f9ee1be8b3ed0bd22607037541d68e36b9a4
Author: Siddharth Seth <sseth@yahoo-inc.com>
Date: Thu Feb 17 13:01:37 2011 -0800

Qualify the paths before figuring out which filesystem
statistics need to be tracked


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20-security-patches@1077792 13f79535-47bb-0310-9956-ffa450edef68

Owen O'Malley há 14 anos atrás
pai
commit
641e7105c6

+ 4 - 4
src/mapred/org/apache/hadoop/mapred/MapTask.java

@@ -189,7 +189,7 @@ class MapTask extends Task {
 
       Statistics matchedStats = null;
       if (split instanceof FileSplit) {
-        matchedStats = getFsStatistics(((FileSplit) split).getPath());
+        matchedStats = getFsStatistics(((FileSplit) split).getPath(), job);
       } 
       fsStats = matchedStats;
       
@@ -480,7 +480,7 @@ class MapTask extends Task {
       Statistics matchedStats = null;
       if (split instanceof org.apache.hadoop.mapreduce.lib.input.FileSplit) {
         matchedStats = getFsStatistics(((org.apache.hadoop.mapreduce.lib.input.FileSplit) split)
-            .getPath());
+            .getPath(), job);
       } 
       fsStats = matchedStats;
 	  
@@ -615,7 +615,7 @@ class MapTask extends Task {
       Statistics matchedStats = null;
       if (outputFormat instanceof org.apache.hadoop.mapreduce.lib.output.FileOutputFormat) {
         matchedStats = getFsStatistics(org.apache.hadoop.mapreduce.lib.output.FileOutputFormat
-            .getOutputPath(jobContext));
+            .getOutputPath(jobContext), job);
       }
       fsStats = matchedStats;
       mapOutputRecordCounter = 
@@ -808,7 +808,7 @@ class MapTask extends Task {
       
       Statistics matchedStats = null;
       if (outputFormat instanceof FileOutputFormat) {
-        matchedStats = getFsStatistics(FileOutputFormat.getOutputPath(job));
+        matchedStats = getFsStatistics(FileOutputFormat.getOutputPath(job), job);
       } 
       fsStats = matchedStats;
       mapOutputRecordCounter = reporter.getCounter(MAP_OUTPUT_RECORDS);

+ 2 - 2
src/mapred/org/apache/hadoop/mapred/ReduceTask.java

@@ -438,7 +438,7 @@ class ReduceTask extends Task {
           .getCounter(FileOutputFormat.Counter.BYTES_WRITTEN);
       Statistics matchedStats = null;
       if (job.getOutputFormat() instanceof FileOutputFormat) {
-        matchedStats = getFsStatistics(FileOutputFormat.getOutputPath(job));
+        matchedStats = getFsStatistics(FileOutputFormat.getOutputPath(job), job);
       }
       fsStats = matchedStats;
 
@@ -560,7 +560,7 @@ class ReduceTask extends Task {
       // getTaskID());
       if (outputFormat instanceof org.apache.hadoop.mapreduce.lib.output.FileOutputFormat) {
         matchedStats = getFsStatistics(org.apache.hadoop.mapreduce.lib.output.FileOutputFormat
-            .getOutputPath(taskContext));
+            .getOutputPath(taskContext), taskContext.getConfiguration());
       }
       fsStats = matchedStats;
 

+ 3 - 1
src/mapred/org/apache/hadoop/mapred/Task.java

@@ -1021,8 +1021,10 @@ abstract public class Task implements Writable, Configurable {
    *          the path.
    * @return a Statistics instance, or null if none is found for the scheme.
    */
-  protected static Statistics getFsStatistics(Path path) {
+  protected static Statistics getFsStatistics(Path path, Configuration conf)
+      throws IOException {
     Statistics matchedStats = null;
+    path = path.getFileSystem(conf).makeQualified(path);
     for (Statistics stats : FileSystem.getAllStatistics()) {
       if (stats.getScheme().equals(path.toUri().getScheme())) {
         matchedStats = stats;