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().
精彩评论