如何找到每个map任务的id?

发布于 2024-09-08 06:30:18 字数 102 浏览 2 评论 0原文

我想获取每个mapper和reducer任务的id,因为我想根据mapper和reducer id来标记这些mapper和reducer的输出。我如何检索每个的 id?

谢谢

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?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

李不 2024-09-15 06:30:18

您可以使用以下代码在地图、设置等功能中打印任务ID。

context.getTaskAttemptID().getTaskID();

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

context.getTaskAttemptID().getTaskID();
懵少女 2024-09-15 06:30:18

您可以使用:org.apache.hadoop.mapreduce.MapContext::getTaskAttemptID() 来完成此操作。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文