开发者

how to find the id of each map task?

开发者 https://www.devze.com 2023-01-06 02:54 出处:网络
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?

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

精彩评论

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