Repository: hadoop Updated Branches: refs/heads/YARN-1011 6d9500c99 -> e5a996e85 (forced update)
HDFS-12542. Update javadoc and documentation for listStatus. Contributed by Ajay Kumar. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/8acdf5c2 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/8acdf5c2 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/8acdf5c2 Branch: refs/heads/YARN-1011 Commit: 8acdf5c2742c081f3e0e96e13eb940a39964a58f Parents: bb0a742 Author: Arpit Agarwal <a...@apache.org> Authored: Wed Oct 11 12:29:35 2017 -0700 Committer: Arpit Agarwal <a...@apache.org> Committed: Wed Oct 11 12:29:35 2017 -0700 ---------------------------------------------------------------------- .../apache/hadoop/hdfs/web/WebHdfsFileSystem.java | 16 ++++++++++++++++ .../hadoop/fs/http/client/HttpFSFileSystem.java | 18 ++++++++++++------ .../hadoop-hdfs/src/site/markdown/WebHDFS.md | 5 +++++ 3 files changed, 33 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/8acdf5c2/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java index d3a8b23..0fb6f22 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java @@ -1495,6 +1495,15 @@ public class WebHdfsFileSystem extends FileSystem } } + /** + * Get {@link FileStatus} of files/directories in the given path. If path + * corresponds to a file then {@link FileStatus} of that file is returned. + * Else if path represents a directory then {@link FileStatus} of all + * files/directories inside given path is returned. + * + * @param f given path + * @return the statuses of the files/directories in the given path + */ @Override public FileStatus[] listStatus(final Path f) throws IOException { statistics.incrementReadOps(1); @@ -1519,6 +1528,13 @@ public class WebHdfsFileSystem extends FileSystem private static final byte[] EMPTY_ARRAY = new byte[] {}; + /** + * Get DirectoryEntries of the given path. DirectoryEntries contains an array + * of {@link FileStatus}, as well as iteration information. + * + * @param f given path + * @return DirectoryEntries for given path + */ @Override public DirectoryEntries listStatusBatch(Path f, byte[] token) throws FileNotFoundException, IOException { http://git-wip-us.apache.org/repos/asf/hadoop/blob/8acdf5c2/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/client/HttpFSFileSystem.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/client/HttpFSFileSystem.java b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/client/HttpFSFileSystem.java index 3ff7a61..ffd64a1 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/client/HttpFSFileSystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/client/HttpFSFileSystem.java @@ -705,14 +705,13 @@ public class HttpFSFileSystem extends FileSystem } /** - * List the statuses of the files/directories in the given path if the path is - * a directory. + * Get {@link FileStatus} of files/directories in the given path. If path + * corresponds to a file then {@link FileStatus} of that file is returned. + * Else if path represents a directory then {@link FileStatus} of all + * files/directories inside given path is returned. * * @param f given path - * - * @return the statuses of the files/directories in the given patch - * - * @throws IOException + * @return the statuses of the files/directories in the given path */ @Override public FileStatus[] listStatus(Path f) throws IOException { @@ -725,6 +724,13 @@ public class HttpFSFileSystem extends FileSystem return toFileStatuses(json, f); } + /** + * Get {@link DirectoryEntries} of the given path. {@link DirectoryEntries} + * contains an array of {@link FileStatus}, as well as iteration information. + * + * @param f given path + * @return {@link DirectoryEntries} for given path + */ @Override public DirectoryEntries listStatusBatch(Path f, byte[] token) throws FileNotFoundException, IOException { http://git-wip-us.apache.org/repos/asf/hadoop/blob/8acdf5c2/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/WebHDFS.md ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/WebHDFS.md b/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/WebHDFS.md index 73c6558..4a1395e 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/WebHDFS.md +++ b/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/WebHDFS.md @@ -467,6 +467,8 @@ See also: [FileSystem](../../api/org/apache/hadoop/fs/FileSystem.html).getFileSt { "accessTime" : 1320171722771, "blockSize" : 33554432, + "childrenNum" : 0, + "fileId" : 16388, "group" : "supergroup", "length" : 24930, "modificationTime": 1320171722771, @@ -474,11 +476,14 @@ See also: [FileSystem](../../api/org/apache/hadoop/fs/FileSystem.html).getFileSt "pathSuffix" : "a.patch", "permission" : "644", "replication" : 1, + "storagePolicy" : 0, "type" : "FILE" }, { "accessTime" : 0, "blockSize" : 0, + "childrenNum" : 0, + "fileId" : 16389, "group" : "supergroup", "length" : 0, "modificationTime": 1320895981256, --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org