Sample Usage of MapReduce
Initialize MapReduce Task.
MapReduceTask task = new MapReduceTask();
Set Mapper, Combiner factory and Reducer factory. Add filters, if required.
task.Mapper = new WordCountMapper();
task.Combiner = new WordCountCombinerFactory();
task.Reducer = new WordCountReducerFactory();
Execute task on cache.
The result of the ExecuteTask()
call is returned to an instance of
ITrackableTask.
ITrackableTask wordCount = cache.ExecuteTask(task);
Optional: enumerate over the result generated using enumeration.
ITaskResult result = wordCount.GetResult();
IDictionaryEnumerator enumResult = result.GetEnumerator();
while (enumResult.MoveNext())
{
//perform operations
}