hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dran...@apache.org
Subject hadoop git commit: HADOOP-14069. AliyunOSS: listStatus returns wrong file info. Contributed by Fei Hui
Date Mon, 13 Feb 2017 05:20:14 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk 839b690ed -> 01be4503c


HADOOP-14069. AliyunOSS: listStatus returns wrong file info. Contributed by Fei Hui


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

Branch: refs/heads/trunk
Commit: 01be4503c3b053d2cff0b179774dabfd267877db
Parents: 839b690
Author: Kai Zheng <kai.zheng@intel.com>
Authored: Mon Feb 13 13:18:20 2017 +0800
Committer: Kai Zheng <kai.zheng@intel.com>
Committed: Mon Feb 13 13:18:20 2017 +0800

----------------------------------------------------------------------
 .../org/apache/hadoop/fs/aliyun/oss/AliyunOSSFileSystem.java  | 2 +-
 .../hadoop/fs/aliyun/oss/TestAliyunOSSFileSystemContract.java | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/01be4503/hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/AliyunOSSFileSystem.java
----------------------------------------------------------------------
diff --git a/hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/AliyunOSSFileSystem.java
b/hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/AliyunOSSFileSystem.java
index 3426319..0491087 100644
--- a/hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/AliyunOSSFileSystem.java
+++ b/hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/AliyunOSSFileSystem.java
@@ -352,7 +352,7 @@ public class AliyunOSSFileSystem extends FileSystem {
             if (LOG.isDebugEnabled()) {
               LOG.debug("Adding: rd: " + keyPath);
             }
-            result.add(new FileStatus(0, true, 1, 0, 0, keyPath));
+            result.add(getFileStatus(keyPath));
           }
         }
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/01be4503/hadoop-tools/hadoop-aliyun/src/test/java/org/apache/hadoop/fs/aliyun/oss/TestAliyunOSSFileSystemContract.java
----------------------------------------------------------------------
diff --git a/hadoop-tools/hadoop-aliyun/src/test/java/org/apache/hadoop/fs/aliyun/oss/TestAliyunOSSFileSystemContract.java
b/hadoop-tools/hadoop-aliyun/src/test/java/org/apache/hadoop/fs/aliyun/oss/TestAliyunOSSFileSystemContract.java
index ad8ef6e..3ebf507 100644
--- a/hadoop-tools/hadoop-aliyun/src/test/java/org/apache/hadoop/fs/aliyun/oss/TestAliyunOSSFileSystemContract.java
+++ b/hadoop-tools/hadoop-aliyun/src/test/java/org/apache/hadoop/fs/aliyun/oss/TestAliyunOSSFileSystemContract.java
@@ -22,6 +22,7 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileAlreadyExistsException;
 import org.apache.hadoop.fs.FileSystemContractBaseTest;
 import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.fs.FileStatus;
 
 import java.io.FileNotFoundException;
 import java.io.IOException;
@@ -206,6 +207,12 @@ public class TestAliyunOSSFileSystemContract
     assertTrue("Should be directory",
         this.fs.getFileStatus(dirPath).isDirectory());
     assertFalse("Should not be file", this.fs.getFileStatus(dirPath).isFile());
+
+    Path parentPath = this.path("/test/oss");
+    for (FileStatus fileStatus: fs.listStatus(parentPath)) {
+      assertTrue("file and directory should be new",
+          fileStatus.getModificationTime() > 0L);
+    }
   }
 
   public void testMkdirsForExistingFile() throws Exception {


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message