hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Felix Borchers (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HADOOP-10798) globStatus() does not return sorted list of files
Date Tue, 08 Jul 2014 13:23:04 GMT
Felix Borchers created HADOOP-10798:
---------------------------------------

             Summary: globStatus() does not return 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
            Priority: Minor


(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.

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.2#6252)

Mime
View raw message