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.

4

1 回答 1

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.

于 2013-03-31T17:19:35.633 回答