HADOOP序列化机制

hadoop序列化机制非常简单,应用Serilizable接口即可,可同时适用Writable,Comparable接口

Block block=new Block(7890843274892473476827643,346783584L,232353458890L);
ByteArrayOutputStream b=new ByteArrayOutputStream();
DataOutputStream data=new dataoutputstream(b);
block.write(data);
data.close();



Hadoop writable机制
两个方法write,readfields

你可能感兴趣的:(HADOOP)