Hadoop 我们如何通过列表<;文本>;作为映射器输出?
我正在研究地图缩小的问题。但我坚持了一点,那就是如何将Hadoop 我们如何通过列表<;文本>;作为映射器输出?,hadoop,mapreduce,Hadoop,Mapreduce,我正在研究地图缩小的问题。但我坚持了一点,那就是如何将列表传递为映射器输出?有没有可能?如果是,那么我们如何告诉配置有关映射器输出类?您可以将该类用作映射器类中的值对象。请参考以下映射器类的代码片段 ArrayWritable arrayWritable = new ArrayWritable(Text.class); Text [] textValues = new Text[2]; textValues[0] = new Text("value1"); textValues[1] = ne
列表
传递为映射器输出
?有没有可能?如果是,那么我们如何告诉配置
有关映射器输出类
?您可以将该类用作映射器类中的值对象。请参考以下映射器类的代码片段
ArrayWritable arrayWritable = new ArrayWritable(Text.class);
Text [] textValues = new Text[2];
textValues[0] = new Text("value1");
textValues[1] = new Text("value1");
arrayWritable.set(textValues );
context.write(key , arrayWritable );
在驱动程序类中设置值类,如下所示:
job.setMapOutputValueClass(ArrayWritable.class);