开发者

how to find the id of each map task?

I want to get the id of each mapper and reducer task because I want to tag the output of these mappers and reducers according to the mapper and reducer id. How can I retrieve the ids of each?

Than开发者_StackOverflow中文版ks


You can print taskId in map, setup etc. functions by utilizing following code.

context.getTaskAttemptID().getTaskID();


you can do it using: org.apache.hadoop.mapreduce.MapContext::getTaskAttemptID().

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜