Return-Path: Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: (qmail 19679 invoked from network); 24 Aug 2009 18:31:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Aug 2009 18:31:54 -0000 Received: (qmail 1963 invoked by uid 500); 24 Aug 2009 18:31:21 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 1902 invoked by uid 500); 24 Aug 2009 18:31:21 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 1890 invoked by uid 99); 24 Aug 2009 18:31:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Aug 2009 18:31:21 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Aug 2009 18:31:19 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 61942234C1E7 for ; Mon, 24 Aug 2009 11:30:59 -0700 (PDT) Message-ID: <1117324999.1251138659398.JavaMail.jira@brutus> Date: Mon, 24 Aug 2009 11:30:59 -0700 (PDT) From: "Jakob Homan (JIRA)" To: hdfs-issues@hadoop.apache.org Subject: [jira] Updated: (HDFS-538) DistributedFileSystem::listStatus incorrectly returns null for empty result sets In-Reply-To: <802678436.1250019374804.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HDFS-538?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jakob Homan updated HDFS-538: ----------------------------- Release Note: Updated DistributedFileSystem::listStatus() method to throw a FileNotFoundException rather than return null in the case that the provided path does not exist. Updated code that relied on checking for null to catch FileNotFoundException. Client code that relied on checking for null should be updated to support the new semantics. (was: Solidify FileSystem contract for listStatus method when the provided path does not exist. The method is now guaranteed to throw a FileNotFoundException, whereas some FileSystem implementations had previously returned null in this case. Existing code that relies on checking for null should be updated to catch or propagate a FileNotFoundException.) Adding correct release note. > DistributedFileSystem::listStatus incorrectly returns null for empty result sets > -------------------------------------------------------------------------------- > > Key: HDFS-538 > URL: https://issues.apache.org/jira/browse/HDFS-538 > Project: Hadoop HDFS > Issue Type: Bug > Reporter: Jakob Homan > Assignee: Jakob Homan > Fix For: 0.21.0 > > Attachments: HDFS-538.patch > > > Currently the listStatus method returns null if no files match the request. This differs from the Checksum/LocalFileSystem implementation, which returns an empty array, and the nontvery-explict prescription of the FileSystem interface: "{{@return the statuses of the files/directories in the given patch}}" It's better to return an empty collection than have to add extra null checks. The method should return an empty array. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.