Return-Path: X-Original-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 11311188B5 for ; Mon, 29 Jun 2015 16:45:06 +0000 (UTC) Received: (qmail 23007 invoked by uid 500); 29 Jun 2015 16:45:05 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 22960 invoked by uid 500); 29 Jun 2015 16:45:05 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 22944 invoked by uid 99); 29 Jun 2015 16:45:05 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Jun 2015 16:45:05 +0000 Date: Mon, 29 Jun 2015 16:45:05 +0000 (UTC) From: "Hudson (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HADOOP-12009) Clarify FileSystem.listStatus() sorting order & fix FileSystemContractBaseTest:testListStatus MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HADOOP-12009?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14605882#comment-14605882 ] Hudson commented on HADOOP-12009: --------------------------------- SUCCESS: Integrated in Hadoop-Mapreduce-trunk-Java8 #241 (See [https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/241/]) HADOOP-12009 Clarify FileSystem.listStatus() sorting order & fix FileSystemContractBaseTest:testListStatus. (J.Andreina via stevel) (stevel: rev 3dfa8161f9412bcb040f3c29c471344f25f24337) * hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java * hadoop-common-project/hadoop-common/CHANGES.txt * hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileSystemContractBaseTest.java * hadoop-common-project/hadoop-common/src/site/markdown/filesystem/filesystem.md > Clarify FileSystem.listStatus() sorting order & fix FileSystemContractBaseTest:testListStatus > ---------------------------------------------------------------------------------------------- > > Key: HADOOP-12009 > URL: https://issues.apache.org/jira/browse/HADOOP-12009 > Project: Hadoop Common > Issue Type: Improvement > Components: test > Reporter: Jakob Homan > Assignee: J.Andreina > Priority: Minor > Fix For: 2.8.0 > > Attachments: HADOOP-12009-003.patch, HADOOP-12009.1.patch > > > FileSystem.listStatus does not guarantee that implementations will return sorted entries: > {code} /** > * List the statuses of the files/directories in the given path if the path is > * a directory. > * > * @param f given path > * @return the statuses of the files/directories in the given patch > * @throws FileNotFoundException when the path does not exist; > * IOException see specific implementation > */ > public abstract FileStatus[] listStatus(Path f) throws FileNotFoundException, > IOException;{code} > However, FileSystemContractBaseTest, expects the elements to come back sorted: > {code} Path[] testDirs = { path("/test/hadoop/a"), > path("/test/hadoop/b"), > path("/test/hadoop/c/1"), }; > > // ... > paths = fs.listStatus(path("/test/hadoop")); > assertEquals(3, paths.length); > assertEquals(path("/test/hadoop/a"), paths[0].getPath()); > assertEquals(path("/test/hadoop/b"), paths[1].getPath()); > assertEquals(path("/test/hadoop/c"), paths[2].getPath());{code} > We should pass this test as long as all the paths are there, regardless of their ordering. -- This message was sent by Atlassian JIRA (v6.3.4#6332)