0

I need clarity in implementing reduce() and map() methods of GridTask,

How can we Pass arguments to these methods,

Map<? extends GridJob, GridNode> 
  map(List<GridNode> subgrid, T arg) throws GridException

R reduce(List<GridJobResult> results) throws GridException

Specifically, I need to know, how to pass/ invoke reduce method, or if it is invoked implicitly, then how and what arguments are passed to it.

Lukas Eder
  • 211,314
  • 129
  • 689
  • 1,509
Sravan U
  • 67
  • 1
  • 7

1 Answers1

0

The arguments are passed from GridProjection.execute(...) method.

Every time a GridJob completes, its result is passed to GridTask.result(...) method. The reduce() method is invoked whenever all results from GridJobs are received. You can also force to reduce sooner by returning REDUCE policy form GridTask.result(...) method.

Dmitriy
  • 2,282
  • 1
  • 11
  • 7
  • Well, Thank you for your reply, i have another doubt about message/ event notification. I want to notify all the nodes to stop and have to send a message to the server node[ the one that initiates all jobs ]. How can i do this? – Sravan U Apr 12 '13 at 14:18
  • or else, tell me how to stop all other jobs from a remote node. – Sravan U Apr 12 '13 at 19:03