Selaa lähdekoodia

HADOOP-5002. Fixes a problem to do with the order of initialization of reduce task and instantiating the reducer class. Contributed by Amareshwari Sriramadasu.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/branches/branch-0.19@736239 13f79535-47bb-0310-9956-ffa450edef68
Devaraj Das 16 vuotta sitten
vanhempi
commit
ebaacc9f90
2 muutettua tiedostoa jossa 5 lisäystä ja 1 poistoa
  1. 4 0
      CHANGES.txt
  2. 1 1
      src/mapred/org/apache/hadoop/mapred/ReduceTask.java

+ 4 - 0
CHANGES.txt

@@ -62,6 +62,10 @@ Release 0.19.1 - Unreleased
     HADOOP-4967. Fixes a race condition in the JvmManager to do with killing
     tasks. (ddas)
 
+    HADOOP-5002. Fixes a problem to do with the order of initialization of
+    reduce task and instantiating the reducer class. 
+    (Amareshwari Sriramadasu via ddas)
+
 Release 0.19.0 - 2008-11-18
 
   INCOMPATIBLE CHANGES

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

@@ -334,7 +334,6 @@ class ReduceTask extends Task {
   public void run(JobConf job, final TaskUmbilicalProtocol umbilical)
     throws IOException {
     job.setBoolean("mapred.skip.on", isSkipping());
-    Reducer reducer = ReflectionUtils.newInstance(job.getReducerClass(), job);
 
     if (!cleanupJob && !setupJob) {
       copyPhase = getProgress().addPhase("copy");
@@ -410,6 +409,7 @@ class ReduceTask extends Task {
       };
     
     // apply reduce function
+    Reducer reducer = ReflectionUtils.newInstance(job.getReducerClass(), job);
     try {
       Class keyClass = job.getMapOutputKeyClass();
       Class valClass = job.getMapOutputValueClass();