我有一個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?我也不想我的計劃......
感謝答案放慢!
同樣的事情,你可以發佈你的映射器/減速器輸入/輸出類型的一些示例代碼? –