You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Wei-Chiu Chuang (JIRA)" <ji...@apache.org> on 2019/08/03 07:38:00 UTC
[jira] [Commented] (HDFS-13759) [HDFS Pagination]Does HDFS Java api
Support Pagination?
[ https://issues.apache.org/jira/browse/HDFS-13759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16899398#comment-16899398 ]
Wei-Chiu Chuang commented on HDFS-13759:
----------------------------------------
You should use DistributedFileSystem instead of DFSClient. The latter is a private API.
DistributedFileSystem offers DirListingIterator for the purpose you described.
> [HDFS Pagination]Does HDFS Java api Support Pagination?
> -------------------------------------------------------
>
> Key: HDFS-13759
> URL: https://issues.apache.org/jira/browse/HDFS-13759
> Project: Hadoop HDFS
> Issue Type: Wish
> Components: fs, fs async
> Affects Versions: 2.6.0, 2.7.0, 2.8.0
> Reporter: wuchang
> Priority: Major
> Labels: HDFS, pagination
>
> I could use *FileSystem*
> {code:java}
> RemoteIterator<FileStatus> listed = fs.listStatusIterator(new Path("hdfs://warehousestore/user/chang.wu/flat_level_1"));{code}
> like this to get files *asynchronously*.
> But in fact what I want is a pagination support, where I could pass two parameters, the
> {code:java}
> offset{code}
> and
> {code:java}
> limit{code}
> , like MySQL does to get part of files under some directory;.
> I know I could just implement the pagination by wrapping the *listStatusIterator*, but I think it looks weird.
> So, why can't HDFS support pagination for user directly?
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)
---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org