在hadoop中传递变量

来源:互联网 发布:js 数组是否包含字符串 编辑:程序博客网 时间:2024/05/29 15:57

在hadoop中传递变量

@(HADOOP)[hadoop]

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

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

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

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