Return-Path: Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: (qmail 21304 invoked from network); 8 Sep 2009 12:18:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Sep 2009 12:18:29 -0000 Received: (qmail 16817 invoked by uid 500); 8 Sep 2009 12:18:29 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 16730 invoked by uid 500); 8 Sep 2009 12:18:29 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 16716 invoked by uid 99); 8 Sep 2009 12:18:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Sep 2009 12:18:29 +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.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Sep 2009 12:18:27 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 2255C23888CD; Tue, 8 Sep 2009 12:18:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r812479 - in /hadoop/common/trunk: CHANGES.txt src/java/org/apache/hadoop/fs/s3native/NativeS3FileSystem.java src/test/core/org/apache/hadoop/fs/s3native/NativeS3FileSystemContractBaseTest.java Date: Tue, 08 Sep 2009 12:18:06 -0000 To: common-commits@hadoop.apache.org From: tomwhite@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090908121807.2255C23888CD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tomwhite Date: Tue Sep 8 12:18:06 2009 New Revision: 812479 URL: http://svn.apache.org/viewvc?rev=812479&view=rev Log: HADOOP-6009. S3N listStatus incorrectly returns null instead of empty array when called on empty root. Contributed by Ian Nowland. Modified: hadoop/common/trunk/CHANGES.txt hadoop/common/trunk/src/java/org/apache/hadoop/fs/s3native/NativeS3FileSystem.java hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/s3native/NativeS3FileSystemContractBaseTest.java Modified: hadoop/common/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/trunk/CHANGES.txt?rev=812479&r1=812478&r2=812479&view=diff ============================================================================== --- hadoop/common/trunk/CHANGES.txt (original) +++ hadoop/common/trunk/CHANGES.txt Tue Sep 8 12:18:06 2009 @@ -987,6 +987,9 @@ HADOOP-6243. Fix a NullPointerException in processing deprecated keys. (Sreekanth Ramakrishnan via yhemanth) + HADOOP-6009. S3N listStatus incorrectly returns null instead of empty + array when called on empty root. (Ian Nowland via tomwhite) + Release 0.20.1 - Unreleased INCOMPATIBLE CHANGES Modified: hadoop/common/trunk/src/java/org/apache/hadoop/fs/s3native/NativeS3FileSystem.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/fs/s3native/NativeS3FileSystem.java?rev=812479&r1=812478&r2=812479&view=diff ============================================================================== --- hadoop/common/trunk/src/java/org/apache/hadoop/fs/s3native/NativeS3FileSystem.java (original) +++ hadoop/common/trunk/src/java/org/apache/hadoop/fs/s3native/NativeS3FileSystem.java Tue Sep 8 12:18:06 2009 @@ -455,6 +455,7 @@ } while (priorLastKey != null); if (status.isEmpty() && + key.length() > 0 && store.retrieveMetadata(key + FOLDER_SUFFIX) == null) { throw new FileNotFoundException("File " + f + " does not exist."); } Modified: hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/s3native/NativeS3FileSystemContractBaseTest.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/s3native/NativeS3FileSystemContractBaseTest.java?rev=812479&r1=812478&r2=812479&view=diff ============================================================================== --- hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/s3native/NativeS3FileSystemContractBaseTest.java (original) +++ hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/s3native/NativeS3FileSystemContractBaseTest.java Tue Sep 8 12:18:06 2009 @@ -48,10 +48,13 @@ } public void testListStatusForRoot() throws Exception { + FileStatus[] paths = fs.listStatus(path("/")); + assertEquals(0, paths.length); + Path testDir = path("/test"); assertTrue(fs.mkdirs(testDir)); - FileStatus[] paths = fs.listStatus(path("/")); + paths = fs.listStatus(path("/")); assertEquals(1, paths.length); assertEquals(path("/test"), paths[0].getPath()); }