Take a look at the sample given in Javadoc of Writable.java
You need to serialize your data yourself:
@Override
public void readFields(DataInput in) throws IOException {
h = Text.readString(in);
sc = in.readFloat();
ran = in.readInt ();
}
On Tue, Apr 27, 2010 at 10:53 AM, Farhan Husain
<[email protected]>wrote:
> Hello,
>
> I want to output a class which I have written as the value of the map
> phase.
> The obvious was is to implement the Writable interface but the problem is
> the class has other classes as its member properties. The DataInput and
> DataOutput interfaces used by the read and write methods of the Writable
> class do not support object serialization. Is there any other way I can
> achieve this?
>
> Thanks,
> Farhan
>