hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-10798) globStatus() should always return a sorted list of files
Date Wed, 01 Jul 2015 14:27:16 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-10798?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14610366#comment-14610366
] 

Hudson commented on HADOOP-10798:
---------------------------------

FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #233 (See [https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/233/])
HADOOP-10798. globStatus() should always return a sorted list of files (cmccabe) (cmccabe:
rev 68e588cbee660d55dba518892d064bee3795a002)
* hadoop-common-project/hadoop-common/CHANGES.txt
* hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/Globber.java
* hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/TestGlobPaths.java


> globStatus() should always return a sorted list of files
> --------------------------------------------------------
>
>                 Key: HADOOP-10798
>                 URL: https://issues.apache.org/jira/browse/HADOOP-10798
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 2.3.0
>            Reporter: Felix Borchers
>            Assignee: Colin Patrick McCabe
>            Priority: Minor
>              Labels: BB2015-05-TBR
>             Fix For: 2.8.0
>
>         Attachments: HADOOP-10798.001.patch
>
>
> (FileSystem) globStatus() does not return a sorted file list anymore.
> But the API says: " ... Results are sorted by their names."
> Seems to be lost, when the Globber Object was introduced. Can't find a sort in actual
code.
> code to check this behavior:
> {code}
>         Configuration conf = new Configuration();
>         FileSystem fs = FileSystem.get(conf);
>         Path path = new Path("/tmp/" + System.currentTimeMillis());
>         fs.mkdirs(path);
>         fs.deleteOnExit(path);
>         fs.createNewFile(new Path(path, "2"));
>         fs.createNewFile(new Path(path, "3"));
>         fs.createNewFile(new Path(path, "1"));
>         FileStatus[] status = fs.globStatus(new Path(path, "*"));
>         Collection list = new ArrayList();
>         for (FileStatus f: status) {
>             list.add(f.getPath().toString());
>             //System.out.println(f.getPath().toString());
>         }
>         boolean sorted = Ordering.natural().isOrdered(list);
>         Assert.assertTrue(sorted);
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message