public static Job Run(Job j) { var mapReducerType = DllLoader.LoadDll(j.Assembly, j.MapReducerClass); var mr = (IMapperReducer)Activator.CreateInstance(mapReducerType); var inputs = j.Inputs; var output = MapReducer.MapReduce(mr, inputs); j.SetResults(output); return(j); }
public static Job Reduce(IList <Job> jA) { var j = jA[0]; var mapReducerType = DllLoader.LoadDll(j.Assembly, j.MapReducerClass); var mr = (IMapperReducer)Activator.CreateInstance(mapReducerType); var isL = new List <ISerializable>(jA.Count); foreach (Job ij in jA) { isL.Add(ij.Results); } var res = MapReducer.Reduce(mr, isL); var retVal = j.Clone(); retVal.SetResults(res); return(retVal); }