Forráskód Böngészése

Set number of reduce tasks to be the number of reduce nodes. This
results in optimal sort performance. Contributed by Owen.


git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@406722 13f79535-47bb-0310-9956-ffa450edef68

Doug Cutting 19 éve
szülő
commit
675ff9a074
1 módosított fájl, 2 hozzáadás és 2 törlés
  1. 2 2
      src/examples/org/apache/hadoop/examples/Sort.java

+ 2 - 2
src/examples/org/apache/hadoop/examples/Sort.java

@@ -69,7 +69,7 @@ public class Sort {
     int num_maps = cluster.getTaskTrackers() * 
          jobConf.getInt("test.sort.maps_per_host", 10);
     int num_reduces = cluster.getTaskTrackers() * 
-        jobConf.getInt("test.sort.reduces_per_host", 10);
+        jobConf.getInt("test.sort.reduces_per_host", cluster.getMaxTasks());
     List otherArgs = new ArrayList();
     for(int i=0; i < args.length; ++i) {
       try {
@@ -109,7 +109,7 @@ public class Sort {
         cluster.getTaskTrackers() +
         " nodes to sort from " + 
         jobConf.getInputPaths()[0] + " into " +
-        jobConf.getOutputPath() + ".");
+        jobConf.getOutputPath() + " with " + num_reduces + " reduces.");
     Date startTime = new Date();
     System.out.println("Job started: " + startTime);
     JobClient.runJob(jobConf);