Return-Path: Delivered-To: apmail-hadoop-hdfs-user-archive@minotaur.apache.org Received: (qmail 38319 invoked from network); 11 Sep 2009 12:47:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Sep 2009 12:47:38 -0000 Received: (qmail 35074 invoked by uid 500); 11 Sep 2009 12:47:37 -0000 Delivered-To: apmail-hadoop-hdfs-user-archive@hadoop.apache.org Received: (qmail 35047 invoked by uid 500); 11 Sep 2009 12:47:37 -0000 Mailing-List: contact hdfs-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-user@hadoop.apache.org Delivered-To: mailing list hdfs-user@hadoop.apache.org Received: (qmail 35028 invoked by uid 99); 11 Sep 2009 12:47:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Sep 2009 12:47:37 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of yubiaoever@gmail.com designates 209.85.216.204 as permitted sender) Received: from [209.85.216.204] (HELO mail-px0-f204.google.com) (209.85.216.204) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Sep 2009 12:47:27 +0000 Received: by pxi42 with SMTP id 42so903975pxi.20 for ; Fri, 11 Sep 2009 05:47:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=k2OpAFYz7IC+HAw4CWslkhNBX5XK5mpW++NhQcVg7PM=; b=Mu6J5b8nFC3wW4rh5oCQ/yLCrmW+MfIZ3Jcm+JEwBIUg/Nk5d7nZ0yjZ0ttwrdVgBU YaRRKIdfkhuNNA+4SPKfGkQRPSpWauIdZ0h3gs+XidLTWO0WpVons3D6UgPNd83V9wmC NY3sfT0vpfMQ1cNaOTYhW1T22AigNTS8XeED0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=eMP9eT8EgBMwxBXFYy28jCEmrvnsvXl7seuMehU7K+Po+gPdTbvQBG2LAvKhN4bjf6 jjGM5rYtpbaUZ4tDiqpn95T8b8Q3x+Aoxb8hKCMcEQSKtrNGz6e2TDAOwrUSGNcznrAj l2b8VPFeo8s5FDVe6mMlGFiXDlJuG/4Hn4h4E= MIME-Version: 1.0 Received: by 10.142.201.19 with SMTP id y19mr270307wff.158.1252673226104; Fri, 11 Sep 2009 05:47:06 -0700 (PDT) In-Reply-To: <6fb160ee0909110135u565cb618x9eb041cf416b763@mail.gmail.com> References: <5b53d3a00909090650v13e325f4mc73ec5aa7bf5b5e7@mail.gmail.com> <6fb160ee0909091013y2d50ad3bg71cbca1e57b48a34@mail.gmail.com> <5b53d3a00909101753l23201324r9bdf64ec6a035cbf@mail.gmail.com> <6fb160ee0909110135u565cb618x9eb041cf416b763@mail.gmail.com> Date: Fri, 11 Sep 2009 20:47:06 +0800 Message-ID: <5b53d3a00909110547w7c833152vb1242bf1ce9f135@mail.gmail.com> Subject: Re: How to define the path of HDFS? From: Bill Yu To: hdfs-user@hadoop.apache.org, jly.list@googlemail.com Content-Type: multipart/alternative; boundary=000e0cd32874a9612104734cb6f8 X-Virus-Checked: Checked by ClamAV on apache.org --000e0cd32874a9612104734cb6f8 Content-Type: text/plain; charset=ISO-8859-1 My purpose is to serialize object to be a node of a btree. ObjectInputStream in = new ObjectInputStream(fs.open(new Path("hdfs://leon1:9000/myDir/trajectory/" + pathToken + ".obj"))); try { tempbtree = (Btree) in.readObject(); } catch (ClassNotFoundException e) { e.printStackTrace(); } Maybe the path is correct , but it throws an error as following : cannot assign instance of [J to field rtree.Bnode.loc of type [Lrtree.Trajectory; in instance of rtree.Bnode How can I solve this problem ? Thank so much for your suggestion. 2009/9/11 Jingkei Ly > Forgive me if I've got the wrong end of the stick as I'm not very clear on > what you are trying to achieve. Based on your original post, I presume you > have a serialized object that you have already stored in HDFS that you would > like to read and deserialize? > If that is the case, then you should use: > > ObjectInputStream in = new ObjectInputStream(FileSystem.open(new > Path("hdfs://localhost:9000/myDir/trajectory/test.obj"))); > > > 2009/9/11 Bill Yu > > Thanks for Jingkei's suggestion . But how can I serialize the input scream >> to create a tree by FileSystem.open() ? >> Anyone 's suggestion is appreciative! >> >> 2009/9/10 Jingkei Ly >> >> You should use FileSystem.open() to obtain an input stream to read from >>> HDFS ( >>> http://hadoop.apache.org/common/docs/current/api/org/apache/hadoop/fs/FileSystem.html#open%28org.apache.hadoop.fs.Path%29 >>> ). >>> >>> 2009/9/9 Bill Yu >>> >>> Hi everyone, >>>> >>>> when I run the following code: >>>> >>>> ObjectInputStream in = new ObjectInputStream(new >>>> FileInputStream("hdfs://localhost:9000/myDir/trajectory/test.obj")); >>>> >>>> it throws an error that the directory is not exist, how can I >>>> define the its path ? >>>> Any suggestion is appreciate ! >>>> >>>> Thanks, >>>> Austin >>> >>> >>> >> > --000e0cd32874a9612104734cb6f8 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable My purpose is to serialize object to be a node of a btree.

=A0Objec= tInputStream in =3D new ObjectInputStream(fs.open(new Path("hdfs://leo= n1:9000/myDir/trajectory/" + pathToken + ".obj")));
=A0tr= y {
=A0=A0=A0=A0 =A0=A0=A0 tempbtree =3D=A0 (Btree) in.readObject();
=A0=A0 = =A0=A0=A0 } catch (ClassNotFoundException e) {
=A0 =A0=A0 =A0 e.printSta= ckTrace();
=A0 }

Maybe the path is correct , but it throws an err= or as following :

cannot assign instance of [J to field rtree.Bnode.= loc of type [Lrtree.Trajectory; in instance of rtree.Bnode

How can I solve this problem ? Thank so much for your suggestion.
2009/9/11 Jingkei Ly <jly.list@googlemail.com>
Forgive me if I&#= 39;ve got the wrong end of the stick as I'm not very clear on what you = are trying to achieve. Based on your original post, I presume you have a se= rialized object that you have already stored in HDFS that you would like to= read and deserialize?

If that is the case, then you should use:

ObjectInputStream in =3D = new ObjectInputStream(FileSystem.open(new Path("hdfs://localhost:9000/= myDir/trajectory/test.obj")));




--000e0cd32874a9612104734cb6f8--