在hadoop中传递变量

来源:互联网 发布:excel导入oracle数据库 编辑:程序博客网 时间:2024/05/15 15:35

在hadoop中传递变量

@(博客文章)[hadoop]

在主类中定义的变量,如定义了一个outputname,需要将其写入conf分发至其它nodemanager:

    Configuration conf = new Configuration();    //需要将变量分发至所有的nodemanager    conf.set("outputname", outputName);

然后在map/reduce中从context获取这个变量:

    context.getConfiguration().get("outputname")
0 0
原创粉丝点击