package ch.zhaw.dna.ssh.mapreduce.model.framework;

/**
 * Dies ist ein neuer MapReduce Task. Er ist für seine Worker der Master.
 * 
 * @author Max
 */
public class MapReduceTask {

	MapTask mapTask;

	ReduceTask reduceTask;

	Pool p = new Pool(); // TODO Scope
	
	

	public MapReduceTask(MapTask mapTask, ReduceTask reduceTask) {
		this.mapTask = mapTask;
		this.reduceTask = reduceTask;
	}

	public void compute(String input) {
		MapRunner mapRunenr = new MapRunner();
		mapRunenr.assignMaster(this.mapTask);
		mapRunenr.runMapTask(input.split(" "), this.p);
		ReduceRunner reduceRunner = new ReduceRunner();
	}

}

@@ -45,16 +45,88 @@
 ework;%0A%0A
+import java.util.HashMap;%0Aimport java.util.List;%0Aimport java.util.Map;%0A%0A
 /**%0A * D
@@ -471,12 +471,33 @@
 lic 
-void
+Map%3CString, List%3CString%3E%3E
  com
@@ -654,54 +654,206 @@
 ;%0A%09%09
-ReduceRunner reduceRunner = new ReduceRunner()
+Map%3CString, List%3CString%3E%3E results = new HashMap%3CString, List%3CString%3E%3E();%0A%09%09ReduceRunner reduceRunner = new ReduceRunner(results);%0A%09%09reduceRunner.reduce(mapRunenr.getIntermediate());%0A%09%09return results
 ;%0A%09%7D

compute with results