Selaa lähdekoodia

MAPREDUCE-5450. Unnecessary Configuration instantiation in IFileInputStream slows down merge. (Stanislav Barton and Ted Yu via Sandy Ryza)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1@1511461 13f79535-47bb-0310-9956-ffa450edef68
Sanford Ryza 12 vuotta sitten
vanhempi
commit
a55bda2d32

+ 3 - 0
CHANGES.txt

@@ -123,6 +123,9 @@ Release 1.3.0 - unreleased
     MAPREDUCE-5367. Local jobs all use same local working directory
     (Sandy Ryza)
 
+    MAPREDUCE-5450. Unnecessary Configuration instantiation in IFileInputStream
+    slows down merge. (Stanislav Barton and Ted Yu via Sandy Ryza)
+
 Release 1.2.1 - 2013.07.15
 
   INCOMPATIBLE CHANGES

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

@@ -462,9 +462,9 @@ class IFile {
     TaskAttemptID taskAttemptId;
     
     public InMemoryReader(RamManager ramManager, TaskAttemptID taskAttemptId,
-                          byte[] data, int start, int length)
+                          byte[] data, int start, int length, Configuration conf)
                           throws IOException {
-      super(null, null, length - start, null, null);
+      super(conf, null, length - start, null, null);
       this.ramManager = ramManager;
       this.taskAttemptId = taskAttemptId;
       

+ 4 - 3
src/mapred/org/apache/hadoop/mapred/ReduceTask.java

@@ -674,7 +674,8 @@ public class ReduceTask extends Task {
   };
 
   public static class ReduceCopier<K, V> implements ShuffleConsumerPlugin, MRConstants {
-
+    private JobConf conf;
+    
     /** Reference to the umbilical object */
     private TaskUmbilicalProtocol umbilical;
     private TaskReporter reporter;
@@ -1944,7 +1945,7 @@ public class ReduceTask extends Task {
     @Override
     public void init (ShuffleConsumerPlugin.Context context)throws ClassNotFoundException, IOException {
       
-      JobConf conf = context.getConf();
+      conf = context.getConf();
       this.reporter = context.getReporter();
       this.umbilical = context.getUmbilical();
       this.reduceTask = context.getReduceTask();
@@ -2442,7 +2443,7 @@ public class ReduceTask extends Task {
           fullSize -= mo.data.length;
           Reader<K, V> reader = 
             new InMemoryReader<K, V>(ramManager, mo.mapAttemptId,
-                                     mo.data, 0, mo.data.length);
+                                     mo.data, 0, mo.data.length, conf);
           Segment<K, V> segment = 
             new Segment<K, V>(reader, true);
           inMemorySegments.add(segment);