public WorkerTaskMetadata receiveTaskRequest(FileSplitMetadata splitMetadata) { /*we need to set the input file part in workerMetadata.chunk*/ String inputCode = this.dllPath; byte[] code = File.ReadAllBytes(inputCode); String workChunk = getSplit(splitMetadata.StartPosition, splitMetadata.EndPosition); //string workChunk = "this is \r\n my nice little \r\n text file and \r\n it has 5 lines"; WorkerTaskMetadata workerMetadata = new WorkerTaskMetadata(code, mapperName, workChunk); //Console.WriteLine(Environment.CurrentDirectory); return(workerMetadata); }
public void receiveTask(FileSplitMetadata splitMetadata)//job tracker will invoke this { if (!WorkerTask.IS_WORKER_FREEZED) { Common.Logger().LogInfo("Task Received ++++++++++++++++ from " + splitMetadata.JobTrackerUrl, string.Empty, string.Empty); CLIENT_URL = splitMetadata.ClientUrl; JOBTRACKER_URL = splitMetadata.JobTrackerUrl; workerTask.addSplitToSplitList(splitMetadata); //we don't block the job tracker as we execute task seperately } else { // workerTask.stopTimer(); throw new RemoteComException(); } }