hadoop git commit: HADOOP-12009. Clarify FileSystem.listStatus() sorting order & fix FileSystemContractBaseTest:testListStatus. backport to 2.8
Repository: hadoop Updated Branches: refs/heads/branch-2 f4d94f224 -> 43a40fa00 HADOOP-12009. Clarify FileSystem.listStatus() sorting order & fix FileSystemContractBaseTest:testListStatus. backport to 2.8 Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/43a40fa0 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/43a40fa0 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/43a40fa0 Branch: refs/heads/branch-2 Commit: 43a40fa00978f41cf12124fb79379a26aecfdc5e Parents: f4d94f2 Author: Jakob HomanAuthored: Thu Jul 23 17:46:13 2015 -0700 Committer: Steve Loughran Committed: Thu Jul 21 21:50:38 2016 +0100 -- .../main/java/org/apache/hadoop/fs/FileSystem.java | 17 - .../src/site/markdown/filesystem/filesystem.md | 4 .../hadoop/fs/FileSystemContractBaseTest.java | 11 --- 3 files changed, 28 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hadoop/blob/43a40fa0/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java -- diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java index 007d90c..88fe3eb 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java @@ -1520,7 +1520,9 @@ public abstract class FileSystem extends Configured implements Closeable { /** * List the statuses of the files/directories in the given path if the path is * a directory. - * + * + * Does not guarantee to return the List of files/directories status in a + * sorted order. * @param f given path * @return the statuses of the files/directories in the given patch * @throws FileNotFoundException when the path does not exist; @@ -1562,6 +1564,9 @@ public abstract class FileSystem extends Configured implements Closeable { /** * Filter files/directories in the given path using the user-supplied path * filter. + * + * Does not guarantee to return the List of files/directories status in a + * sorted order. * * @param f * a path name @@ -1582,6 +1587,9 @@ public abstract class FileSystem extends Configured implements Closeable { /** * Filter files/directories in the given list of paths using default * path filter. + * + * Does not guarantee to return the List of files/directories status in a + * sorted order. * * @param files * a list of paths @@ -1598,6 +1606,9 @@ public abstract class FileSystem extends Configured implements Closeable { /** * Filter files/directories in the given list of paths using user-supplied * path filter. + * + * Does not guarantee to return the List of files/directories status in a + * sorted order. * * @param files * a list of paths @@ -1761,6 +1772,8 @@ public abstract class FileSystem extends Configured implements Closeable { * while consuming the entries. Each file system implementation should * override this method and provide a more efficient implementation, if * possible. + * Does not guarantee to return the iterator that traverses statuses + * of the files in a sorted order. * * @param p target path * @return remote iterator @@ -1788,6 +1801,8 @@ public abstract class FileSystem extends Configured implements Closeable { /** * List the statuses and block locations of the files in the given path. + * Does not guarantee to return the iterator that traverses statuses + * of the files in a sorted order. * * If the path is a directory, * if recursive is false, returns files in the directory; http://git-wip-us.apache.org/repos/asf/hadoop/blob/43a40fa0/hadoop-common-project/hadoop-common/src/site/markdown/filesystem/filesystem.md -- diff --git a/hadoop-common-project/hadoop-common/src/site/markdown/filesystem/filesystem.md b/hadoop-common-project/hadoop-common/src/site/markdown/filesystem/filesystem.md index d2e1712..778cff4 100644 --- a/hadoop-common-project/hadoop-common/src/site/markdown/filesystem/filesystem.md +++ b/hadoop-common-project/hadoop-common/src/site/markdown/filesystem/filesystem.md @@ -152,6 +152,10 @@ to the same path: forall fs in listStatus(Path) : fs == getFileStatus(fs.path) +**Ordering of results**: there is no guarantee of ordering of the listed entries. +While HDFS currently returns an alphanumerically sorted
hadoop git commit: HADOOP-12009. Clarify FileSystem.listStatus() sorting order & fix FileSystemContractBaseTest:testListStatus. backport to 2.8
Repository: hadoop Updated Branches: refs/heads/branch-2.8 3dcbd2df5 -> 9442e1d48 HADOOP-12009. Clarify FileSystem.listStatus() sorting order & fix FileSystemContractBaseTest:testListStatus. backport to 2.8 Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/9442e1d4 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/9442e1d4 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/9442e1d4 Branch: refs/heads/branch-2.8 Commit: 9442e1d48ea7303a8765056ff087a513d0478719 Parents: 3dcbd2d Author: Jakob HomanAuthored: Thu Jul 23 17:46:13 2015 -0700 Committer: Steve Loughran Committed: Thu Jul 21 21:50:25 2016 +0100 -- .../main/java/org/apache/hadoop/fs/FileSystem.java | 17 - .../src/site/markdown/filesystem/filesystem.md | 4 .../hadoop/fs/FileSystemContractBaseTest.java | 11 --- 3 files changed, 28 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hadoop/blob/9442e1d4/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java -- diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java index e876c3a..14da0d3 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java @@ -1515,7 +1515,9 @@ public abstract class FileSystem extends Configured implements Closeable { /** * List the statuses of the files/directories in the given path if the path is * a directory. - * + * + * Does not guarantee to return the List of files/directories status in a + * sorted order. * @param f given path * @return the statuses of the files/directories in the given patch * @throws FileNotFoundException when the path does not exist; @@ -1557,6 +1559,9 @@ public abstract class FileSystem extends Configured implements Closeable { /** * Filter files/directories in the given path using the user-supplied path * filter. + * + * Does not guarantee to return the List of files/directories status in a + * sorted order. * * @param f * a path name @@ -1577,6 +1582,9 @@ public abstract class FileSystem extends Configured implements Closeable { /** * Filter files/directories in the given list of paths using default * path filter. + * + * Does not guarantee to return the List of files/directories status in a + * sorted order. * * @param files * a list of paths @@ -1593,6 +1601,9 @@ public abstract class FileSystem extends Configured implements Closeable { /** * Filter files/directories in the given list of paths using user-supplied * path filter. + * + * Does not guarantee to return the List of files/directories status in a + * sorted order. * * @param files * a list of paths @@ -1756,6 +1767,8 @@ public abstract class FileSystem extends Configured implements Closeable { * while consuming the entries. Each file system implementation should * override this method and provide a more efficient implementation, if * possible. + * Does not guarantee to return the iterator that traverses statuses + * of the files in a sorted order. * * @param p target path * @return remote iterator @@ -1783,6 +1796,8 @@ public abstract class FileSystem extends Configured implements Closeable { /** * List the statuses and block locations of the files in the given path. + * Does not guarantee to return the iterator that traverses statuses + * of the files in a sorted order. * * If the path is a directory, * if recursive is false, returns files in the directory; http://git-wip-us.apache.org/repos/asf/hadoop/blob/9442e1d4/hadoop-common-project/hadoop-common/src/site/markdown/filesystem/filesystem.md -- diff --git a/hadoop-common-project/hadoop-common/src/site/markdown/filesystem/filesystem.md b/hadoop-common-project/hadoop-common/src/site/markdown/filesystem/filesystem.md index d2e1712..778cff4 100644 --- a/hadoop-common-project/hadoop-common/src/site/markdown/filesystem/filesystem.md +++ b/hadoop-common-project/hadoop-common/src/site/markdown/filesystem/filesystem.md @@ -152,6 +152,10 @@ to the same path: forall fs in listStatus(Path) : fs == getFileStatus(fs.path) +**Ordering of results**: there is no guarantee of ordering of the listed entries. +While HDFS currently returns an alphanumerically