Hadoop排序实例

本文介绍了如何使用Hadoop的map/reduce框架进行排序实例,包括IdentityMapper和IdentityReducer的使用。首先,通过RandomWriter生成10GB/node的随机数据,然后利用sort实例进行排序,以此作为可扩展的集群规模基准测试。默认设置为1.0*capacity的reducer数量,但在某些情况下,1.75*capacity可能获得更优结果。排序实例支持多种命令行选项,详细信息可参考DevelopmentCommandLineOptions。
摘要由CSDN通过智能技术生成

排序实例

排序实例仅仅用 map/reduce框架来把输入目录排序放到输出目录。输入和输出必须是顺序文件,键和值是BytesWritable.

mapper是预先定义的IdentityMapper,reducer 是预先定义的 IdentityReducer, 两个都是把输入直接的输出。

要运行这个例 子:bin/hadoop jar hadoop-*-examples.jar sort [-m <#maps>] [-r <#reduces>]

运行排序基准测试

为了使得排序例子作为一个 基准测试,用 RandomWriter产 生10GB/node 的数据。然后用排序实例来进行排序。这个提供了一个可扩展性依赖于集群的大小的排序基准。默认情况下,排序实例用1.0*capacity作为 reduces的数量,依赖于你的集群的大小你可能会在1.75*capacity的情况下得到更好的结果。

To use the sort example as a benchmark, generate 10GB/node of random data using RandomWriter. Then sort the data using the sort example. This provides a sort benchmark that scales depending on the size of the cluster. By default, the sort example uses 1.0 * capacity for the number of reduces and depending on your cluster you may

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值