hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [1/2] hadoop git commit: Revert "HADOOP-12009 Clarify FileSystem.listStatus() sorting order & fix FileSystemContractBaseTest:testListStatus. (J.Andreina via stevel)"
Date Tue, 30 Jun 2015 10:54:27 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 bc06d5b04 -> 6719fc94e
  refs/heads/trunk 7ba5bbac0 -> 076948d9a


Revert "HADOOP-12009 Clarify FileSystem.listStatus() sorting order & fix  FileSystemContractBaseTest:testListStatus.
(J.Andreina via stevel)"

This reverts commit f02c06965c7caecb64c56c65b03648e998643c67.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/6719fc94
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/6719fc94
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/6719fc94

Branch: refs/heads/branch-2
Commit: 6719fc94e123dbf562e2b46d76837246ddec6438
Parents: bc06d5b
Author: Steve Loughran <stevel@apache.org>
Authored: Tue Jun 30 11:53:03 2015 +0100
Committer: Steve Loughran <stevel@apache.org>
Committed: Tue Jun 30 11:53:03 2015 +0100

----------------------------------------------------------------------
 hadoop-common-project/hadoop-common/CHANGES.txt    |  4 ----
 .../main/java/org/apache/hadoop/fs/FileSystem.java | 17 +----------------
 .../src/site/markdown/filesystem/filesystem.md     |  4 ----
 .../hadoop/fs/FileSystemContractBaseTest.java      | 11 +++--------
 4 files changed, 4 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/6719fc94/hadoop-common-project/hadoop-common/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt
index 11757e6..31d915d 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -163,10 +163,6 @@ Release 2.8.0 - UNRELEASED
 
     HADOOP-11958. MetricsSystemImpl fails to show backtrace when an error
     occurs (Jason Lowe via jeagles)
-
-    HADOOP-12009 Clarify FileSystem.listStatus() sorting order & fix
-    FileSystemContractBaseTest:testListStatus. (J.Andreina via stevel)
-
   OPTIMIZATIONS
 
     HADOOP-11785. Reduce the number of listStatus operation in distcp

http://git-wip-us.apache.org/repos/asf/hadoop/blob/6719fc94/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 c4e7953..800d132 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
@@ -1498,9 +1498,7 @@ 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.
-   * <p>
-   * 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;
@@ -1542,9 +1540,6 @@ public abstract class FileSystem extends Configured implements Closeable
{
   /**
    * Filter files/directories in the given path using the user-supplied path
    * filter.
-   * <p>
-   * Does not guarantee to return the List of files/directories status in a
-   * sorted order.
    * 
    * @param f
    *          a path name
@@ -1565,9 +1560,6 @@ public abstract class FileSystem extends Configured implements Closeable
{
   /**
    * Filter files/directories in the given list of paths using default
    * path filter.
-   * <p>
-   * Does not guarantee to return the List of files/directories status in a
-   * sorted order.
    * 
    * @param files
    *          a list of paths
@@ -1584,9 +1576,6 @@ public abstract class FileSystem extends Configured implements Closeable
{
   /**
    * Filter files/directories in the given list of paths using user-supplied
    * path filter.
-   * <p>
-   * Does not guarantee to return the List of files/directories status in a
-   * sorted order.
    * 
    * @param files
    *          a list of paths
@@ -1748,8 +1737,6 @@ 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
@@ -1777,8 +1764,6 @@ 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/6719fc94/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 f323374..84e3755 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
@@ -183,10 +183,6 @@ 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 list, neither the Posix `readdir()`
-nor Java's `File.listFiles()` API calls define any ordering of returned values. Applications
-which require a uniform sort order on the results must perform the sorting themselves.
 
 ### Atomicity and Consistency
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/6719fc94/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileSystemContractBaseTest.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileSystemContractBaseTest.java
b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileSystemContractBaseTest.java
index f3d33df..84e4e43 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileSystemContractBaseTest.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileSystemContractBaseTest.java
@@ -20,7 +20,6 @@ package org.apache.hadoop.fs;
 
 import java.io.FileNotFoundException;
 import java.io.IOException;
-import java.util.ArrayList;
 
 import junit.framework.TestCase;
 
@@ -204,13 +203,9 @@ public abstract class FileSystemContractBaseTest extends TestCase {
 
     paths = fs.listStatus(path("/test/hadoop"));
     assertEquals(3, paths.length);
-    ArrayList<String> list = new ArrayList<String>();
-    for (FileStatus fileState : paths) {
-      list.add(fileState.getPath().toString());
-    }
-    assertTrue(list.contains(path("/test/hadoop/a")));
-    assertTrue(list.contains(path("/test/hadoop/b")));
-    assertTrue(list.contains(path("/test/hadoop/c")));
+    assertEquals(path("/test/hadoop/a"), paths[0].getPath());
+    assertEquals(path("/test/hadoop/b"), paths[1].getPath());
+    assertEquals(path("/test/hadoop/c"), paths[2].getPath());
 
     paths = fs.listStatus(path("/test/hadoop/a"));
     assertEquals(0, paths.length);


Mime
View raw message