Exemplo n.º 1
0
 public static void runMRJob(RunMR runMRRequest, List <TaskAssigment> assigments)
 {
     foreach (var assigment in assigments)
     {
         Worker.PrepareMRTask request = new Worker.PrepareMRTask {
             fileNameIn     = runMRRequest.fileNameIn,
             fileNameOut    = runMRRequest.fileNameOut,
             fileWithDll    = runMRRequest.fileWithDll,
             taskAssigments = assigments
         };
         var client = new JsonServiceClient(assigment.workerIP);
         Worker.PrepareMRTaskResponse response = null;
         try {
             log.InfoFormat("Sending task to {0}", assigment.workerIP);
             response = client.Put(request);
         } catch (Exception e) {
             log.Error(e);
             throw new Exception("Error during sending tasks to workers!");
         }
     }
     foreach (var assigment in assigments)
     {
         var client = new JsonServiceClient(assigment.workerIP);
         log.InfoFormat("Running task on {0}", assigment.workerIP);
         client.Put(new Worker.RunMRTask());
     }
 }
        public object Any(RunMR request)
        {
            var taskAssigment = MapReduceUtils.scheduleMRJob(request.fileNameIn, request.fileNameOut);

            MapReduceUtils.runMRJob(request, taskAssigment);
            return(new RunMRResponse());
        }