hadoop-hdfs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From unmesha sreeveni <unmeshab...@gmail.com>
Subject Write an object into hadoop hdfs issue
Date Mon, 30 Dec 2013 10:45:55 GMT
I am trying to write an object into hdfs .


public static Split *currentsplit *= new Split();

*Split currentsplit = new Split();*
*Path p = new Path("C45/mysavedobject");*
*ObjectOutputStream oos = new ObjectOutputStream(fs.create(p));*
*oos.writeObject(currentsplit);*
*oos.close();*

But I am not able to get the exact object value.

*Path p = new Path("C45/mysavedobject");*
*Split curntsplit = null;*
*ObjectInputStream ois = new ObjectInputStream(fs.open(p));*
*try {*
*    curntsplit = (Split) ois.readObject();*
*} catch (ClassNotFoundException e) {*
*    // TODO Auto-generated catch block*
*    e.printStackTrace();*
*}*
* ois.close();*

Showing duplicate objects value.

In driver i am getting :

*objjjjjjj in driver pck.Split@14da173c*

After writing the object into file and reading back within driver itself I
am getting an alternate object value.

*objjjjjj in mysavedobject pck.Split@62eade0*


I want the driver object along my Mapper code.

Why is it so?

-- 
*Thanks & Regards*

Unmesha Sreeveni U.B

Mime
View raw message