我有一个Java MR程序。我的地图方法的输出是各种字符串/数字,我现在把它放在一个字符串中。在减少我分割字符串,然后使用参数。现在我想知道这样做是否容易。Hadoop Map Reduce:MapOutputValueClass:Map <String,String>?
我想在那里我存储我的字符串/数字与它描述了每个值的键名为值的地图。这个地图将是我的“超值”(MapOutputValueClass)。
这可能吗?正如我在实况读这个我想我的想法是不实现的:
The key and value classes have to be serializable by the framework and hence need to implement the Writable interface. Additionally, the key classes have to implement the WritableComparable interface to facilitate sorting by the framework.
所以,你会建议我选择我的MapOutputValueClass? :-)也许带一个Map并将其转换为ImmutableBytesWritable?我也不想我的计划......
感谢答案放慢!
同样的事情,你可以发布你的映射器/减速器输入/输出类型的一些示例代码? –