Monday 13 July 2015

Serialization and Deserialization

Serialization is the process of converting strucured objects into a byte stream.

This is used for transmission of data between nodes.

The recieving node has to deserialize it.

persistant storage: permanent storage.

Writable Interface
{
void write(DataOutput out) throws IOException;
void readFields(DataInput in) throws IOException;
}

Writable Comparable Interface;
public int compareTo(MyWritableComparable w)
{
int thisvalue=this.value;
int thatvalue=((IntWritable)o).value;
return (thisvalue<thatvalue?-1:(thisvalue==thatvalue?0:1))
}

The above function is needed to compare Composite keys.


No comments:

Post a Comment