0

I have a Map{String,Object}. Here the Object(value for the map) could be either a String or Map{String,String}.

So if I split up the Map it could be something like this :

Map{String,Map{string,String}} and Map{String,String}

I want to write this Map to Hadoop DFS using sequence file in a key,value pair. I want this Map to be value for by sequence file and hence needs to make it writable. I have written on class but it gives me issues if I write multiple records, then while reading it back, values from adjacent records gets mixed up.

Please suggest me some solution to this problem, or sample code to make this nested Map writable.

4

1 回答 1

0

您不应该使您的地图可写,您可以使用您选择的序列化框架(如 java 序列化或 protobuf)将其序列化为字节,并将字节写入您的序列文件。

于 2012-10-12T06:54:03.337 回答