Return-Path: X-Original-To: apmail-hadoop-mapreduce-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-mapreduce-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 1115510F21 for ; Sat, 3 Aug 2013 17:23:19 +0000 (UTC) Received: (qmail 68080 invoked by uid 500); 3 Aug 2013 17:23:13 -0000 Delivered-To: apmail-hadoop-mapreduce-user-archive@hadoop.apache.org Received: (qmail 67852 invoked by uid 500); 3 Aug 2013 17:23:11 -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 67834 invoked by uid 99); 3 Aug 2013 17:23:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Aug 2013 17:23:10 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of shahab.yunus@gmail.com designates 209.85.214.53 as permitted sender) Received: from [209.85.214.53] (HELO mail-bk0-f53.google.com) (209.85.214.53) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Aug 2013 17:23:06 +0000 Received: by mail-bk0-f53.google.com with SMTP id d7so529019bkh.26 for ; Sat, 03 Aug 2013 10:22:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=QDf7tayCWR9wfPIXxDlNyNqdWFC4DJMC2KfKvD8yJhc=; b=1Cq1l7quzcmJkfUBUQGfd+KdwiLU3tkGrp5v8irNwqzmdxTiAmq3ymjYEDXcd767Lc +xtyF4xYTgOHvtSia1TwR0R5XBVmPKdfppWptGLa2QqQeZvTirNjgAZP9OneqdUbbyW7 AXdsrjnEjrEB2jUOyyIgy3rFl9ZOp1vlzcg8BnYG/xP8JkpsKjOOamyjmvmqBFVJcCCP /BkIDsSAKo83ji5RsNsmnGtDGL2Z9w0yySeuly/QxYqSeRX70RXy6t4F6c7h2MtWeIf1 vOTcgc5G9bddDvJUSWADySIScqFh76JSPS9Ldk6/dObdC8UY4Z6iLzJox6+UokQ/13Vs JmmA== MIME-Version: 1.0 X-Received: by 10.204.2.200 with SMTP id 8mr1864904bkk.92.1375550564649; Sat, 03 Aug 2013 10:22:44 -0700 (PDT) Received: by 10.204.188.71 with HTTP; Sat, 3 Aug 2013 10:22:44 -0700 (PDT) In-Reply-To: References: Date: Sat, 3 Aug 2013 13:22:44 -0400 Message-ID: Subject: Re: How to construct path to a HDFS dir in local host From: Shahab Yunus To: "user@hadoop.apache.org" Content-Type: multipart/alternative; boundary=047d7bfcfe2ec6f9ce04e30e52e6 X-Virus-Checked: Checked by ClamAV on apache.org --047d7bfcfe2ec6f9ce04e30e52e6 Content-Type: text/plain; charset=ISO-8859-1 I think you need to have a user folder (with whatever user you are running hadoop) and put your files there. In fact that folder should be already created there. The hdfsr data dir property is for setting the path to the data files. Regards, Shahab On Fri, Aug 2, 2013 at 9:38 PM, Huy Pham wrote: > So I am trying to get the content of a HDFS dir. The instruction gives > an example like this: > FileStatus[] status = fs.listStatus(new Path("hdfs:// > jp.seka.com:9000/user/jeka/in")); > But now I need to apply this example to my local host, which has HDFS dir > "/data". I tried putting "/data" and "hdfs://localhost/data" but it still > said "file not found" in the output. > The code I use can be found here: > https://sites.google.com/site/hadoopandhive/home/how-to-read-all-files-in-a-directory-in-hdfs-using-hadoop-filesystem-api > Can someone explain how to put the right string for the path? > Thanks > --047d7bfcfe2ec6f9ce04e30e52e6 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I think you need to have a user folder (with whatever user= you are running hadoop) and put your files there. In fact that folder shou= ld be already created there. The hdfsr data dir property is for setting the= path to the data files.

Regards,
Shahab


On Fri, Aug 2, 2013 at 9:38 PM, Huy = Pham <phamvh@yahoo-inc.com> wrote:
So I am trying to get the content of a HDFS dir. The instruction gives= an example like this:
FileStatus[] status =3D= fs.listStatus(new Path("hdfs://jp.seka.com:9000/user/jeka/in"));
But now I need to apply this example to my local host, which has HDFS = dir "/data". I tried putting "/data" and "hdfs://l= ocalhost/data" but it still said "file not found" in the out= put.
Can someone explain how to put the right string for the path?
Thanks

--047d7bfcfe2ec6f9ce04e30e52e6--