Return-Path: X-Original-To: apmail-hadoop-hdfs-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 804081098E for ; Mon, 30 Dec 2013 10:46:34 +0000 (UTC) Received: (qmail 66995 invoked by uid 500); 30 Dec 2013 10:46:25 -0000 Delivered-To: apmail-hadoop-hdfs-user-archive@hadoop.apache.org Received: (qmail 66896 invoked by uid 500); 30 Dec 2013 10:46:24 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hadoop.apache.org Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 66889 invoked by uid 99); 30 Dec 2013 10:46:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Dec 2013 10:46:23 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of unmeshabiju@gmail.com designates 209.85.220.169 as permitted sender) Received: from [209.85.220.169] (HELO mail-vc0-f169.google.com) (209.85.220.169) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Dec 2013 10:46:16 +0000 Received: by mail-vc0-f169.google.com with SMTP id hu19so5833918vcb.14 for ; Mon, 30 Dec 2013 02:45:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=vgJbtgmYyM1MlDPLZEhIcWa9uMezEDwKZrzvHwA/hdQ=; b=wDrbrvjAETec86YjZuXTNQy+qf1R/ZZ2Vgcm4lz1rBGOdaCNIdANXobAYIyo9jARsG z9bG87Qv1mdkZ9KDjT1932cbcJd6OYjup82Jb1SM9mKTj3TRu5CZry2pT84SxY8XBq7F UBTbkWP8YshsI2aAL5HFtu6suWzh+mVylQZVJfsSf/pPu2FTWeS+J1mi9kThlY/VmKHu KXY1A9HAUoo5Yuy1wTImpPGDuGsCotGOYxBpDVAwfB3GLPNUhXYbwJU6iB2XkDpAkfHs oC/ZXuPbmGmJmm7ig9m7pNoWJkmMVtfSGyQO7sYYYDlXNYl7lH+SEuu0jQpj7lSh+cUf 0rxw== MIME-Version: 1.0 X-Received: by 10.58.186.233 with SMTP id fn9mr1312943vec.31.1388400355538; Mon, 30 Dec 2013 02:45:55 -0800 (PST) Received: by 10.59.8.2 with HTTP; Mon, 30 Dec 2013 02:45:55 -0800 (PST) Date: Mon, 30 Dec 2013 16:15:55 +0530 Message-ID: Subject: Write an object into hadoop hdfs issue From: unmesha sreeveni To: User Hadoop Content-Type: multipart/alternative; boundary=047d7b6da93effa32804eebe25b8 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b6da93effa32804eebe25b8 Content-Type: text/plain; charset=ISO-8859-1 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 --047d7b6da93effa32804eebe25b8 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
= I am trying to write an object into hdfs= .


=
publi= c static Split currentsplit=A0=3D new= Split();
Split currentsplit =3D new Split();
Path p =3D new Path("C45/mysaved= object");
ObjectOutputStream oos =3D new ObjectOutputStream(fs= .create(p));
oos.writ= eObject(currentsplit);
oos.close();

But I am not able to get th= e exact object value.

Split curn= tsplit =3D null;
ObjectIn= putStream ois =3D new ObjectInputStream(fs.open(p));
try {
=A0 =A0 = curntsplit =3D (Split) ois.readObject();
} catch (ClassNotFoundExce= ption e) {
=A0 =A0 = // TODO Auto-generated catch block
=A0 =A0 e.printStackTrace();=
}
<= i>=A0ois.close();

Showing duplicate objects value.

In driver i am getting :

objjj= jjjj in driver pck.Split@14da173c

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

=
ob= jjjjjj in mysavedobject pck.Split@62eade0


I want the dri= ver object along my Mapper code.

=
Why i= s it so?

--
Thanks & Regards

Unmesha Sreeveni U.B

--047d7b6da93effa32804eebe25b8--