I know in Hadoop we can implement multi-threaded, asynchronous mapping with
class MapRunnable. But this don't exist the  similar class to do
multi-threaded in reduce phrase. Could we do milti-thread in reduce phrase?.
Does the following code work?

public void reduce(WritableComparable key, Iterator values,
                     OutputCollector output, Reporter reporter) {
     new SomeThread(output).start(); // transfer OutputCollector to thread
}

public class SomeThread extend Thread {
   OutputCollector ouput;
   public SomeThread(OutputCollector output) {
     this.output = output;
   }
   public void run() {
     output.collect(key, value);
   }
}

Reply via email to