Return-Path: X-Original-To: apmail-hadoop-common-user-archive@www.apache.org Delivered-To: apmail-hadoop-common-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6A07110F74 for ; Sat, 3 Aug 2013 17:39:45 +0000 (UTC) Received: (qmail 87398 invoked by uid 500); 3 Aug 2013 17:39:38 -0000 Delivered-To: apmail-hadoop-common-user-archive@hadoop.apache.org Received: (qmail 87270 invoked by uid 500); 3 Aug 2013 17:39:37 -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 87261 invoked by uid 99); 3 Aug 2013 17:39:36 -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:39:36 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of harsh@cloudera.com designates 209.85.219.42 as permitted sender) Received: from [209.85.219.42] (HELO mail-oa0-f42.google.com) (209.85.219.42) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Aug 2013 17:39:32 +0000 Received: by mail-oa0-f42.google.com with SMTP id i18so3640017oag.29 for ; Sat, 03 Aug 2013 10:39:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:x-gm-message-state; bh=qrP5mE4sPkSS0v8dvxm90CQ5UKsbxWwtVk7bE0By/jU=; b=j1P/5V4b30l5U8IYzf0tevqySg+yB8CdS/LKbfVobsV6I3Hc2N3Sqlw6i2do01cKAI hdS6mURB1ASB5Xae2mfcDTIuuiStljg6CxbMA5VKSN/29Jm1/6hbNbZw2cxWuPhwHaPs W3p5kzJgJjogl5IN3hKduKndtPrcF6L1mtBs8o9YcC0N/Ao8+FqamiEeLihkP2yL5DrL nLq/dBf2Hbcaje2CFfiCMFn2A2o8URw/GVu7oM4NDpgVRV+yecoREJQlVq4yJbbj5pbT FvW7dEs83jvmwZxrxpORZ5S8hjjvMvjFijYD7Jk3854X27iBq0c44tu5vn5BCnlRjVM7 7tkg== X-Received: by 10.43.2.68 with SMTP id nt4mr830327icb.0.1375551551603; Sat, 03 Aug 2013 10:39:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.87.164 with HTTP; Sat, 3 Aug 2013 10:38:51 -0700 (PDT) In-Reply-To: References: From: Harsh J Date: Sat, 3 Aug 2013 23:08:51 +0530 Message-ID: Subject: Re: How to construct path to a HDFS dir in local host To: "" Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQnt+ViN56NF7DkivphLXALcY88+JreNXDia2H+9KGpj2JYFTAg0pN1ZfQT9/HON8i9kTLz3 X-Virus-Checked: Checked by ClamAV on apache.org Ensure you also initialize the FileSystem object (fs) against the right FS URI. It may be trying to resolve /data as a LocalFS path. On Sat, Aug 3, 2013 at 7:08 AM, 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 -- Harsh J