You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Kihwal Lee (JIRA)" <ji...@apache.org> on 2014/09/22 17:57:34 UTC

[jira] [Commented] (HADOOP-10987) Provide an iterator-based listing API for FileSystem

    [ https://issues.apache.org/jira/browse/HADOOP-10987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14143334#comment-14143334 ] 

Kihwal Lee commented on HADOOP-10987:
-------------------------------------

I will take option #1.  I am making the protected method public.  The protected version of {{listLocatedStatus()}} exists for {{FilterFileSystem}} implementations like {{ChecksumFileSystem}}, which will needs a composite filter for applying both user-defined filter and its internal filter after this change. Then users directly calling {{listLocatedStatus(Path, PathFilter)}} and hitting a symlink to {{ChecksumFileSystem}} will get the correct result.   The new {{listStatusIterator()}} method should be made similar in order to properly support it in {{ChecksumFileSystem}}.  This approach will also make it easier to covert FsShell to use RemoteIterator-based listing.

> Provide an iterator-based listing API for FileSystem
> ----------------------------------------------------
>
>                 Key: HADOOP-10987
>                 URL: https://issues.apache.org/jira/browse/HADOOP-10987
>             Project: Hadoop Common
>          Issue Type: Improvement
>            Reporter: Kihwal Lee
>            Assignee: Kihwal Lee
>         Attachments: HADOOP-10987.patch
>
>
> Iterator based listing methods already exist in {{FileContext}} for both simple listing and listing with locations. However, {{FileSystem}} lacks the former.  From what I understand, it wasn't added to {{FileSystem}} because it was believed to be phased out soon. Since {{FileSystem}} is very well alive today and new features are getting added frequently, I propose adding an iterator based {{listStatus}} method. As for the name of the new method, we can use the same name used in {{FileContext}} : {{listStatusIterator()}}.
> It will be particularly useful when listing giant directories. Without this, the client has to build up a huge data structure and hold it in memory. We've seen client JVMs running out of memory because of this.
> Once this change is made, we can modify FsShell, etc. in followup jiras.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)