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 "Steve Loughran (JIRA)" <ji...@apache.org> on 2016/08/27 11:38:20 UTC

[jira] [Commented] (HADOOP-13371) S3A globber to use bulk listObject call over recursive directory scan

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

Steve Loughran commented on HADOOP-13371:
-----------------------------------------

There's a more minimal strategy here which is lower risk and culls some of the obvious inefficiencies

# when a pattern without regexps come in, revert to a fast list
# If, the pattern is just a trailing `/*.suffix` entry, listFiles -with filter. Or even better, give the trailing suffix as the terminator for the listing, so having the blobstore do the filtering.
# if the pattern has a trailing * patterns, list everything in the parent dir.

you could probably combine 2 & 3 to match */*.gz patterns. 

trying to handle deeper paths, like */*/* is harder because that's actually asking for all paths exactly three deep.
We're hampered a bit by the way the API returns a full array, stopping us querying as the iteration goes along.

Also: need to retain that special 'null' return use case purely because the FS shell needs it. 

> S3A globber to use bulk listObject call over recursive directory scan
> ---------------------------------------------------------------------
>
>                 Key: HADOOP-13371
>                 URL: https://issues.apache.org/jira/browse/HADOOP-13371
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: fs, fs/s3
>    Affects Versions: 2.8.0
>            Reporter: Steve Loughran
>            Assignee: Steve Loughran
>
> HADOOP-13208 produces O(1) listing of directory trees in {{FileSystem.listStatus}} calls, but doesn't do anything for {{FileSystem.globStatus()}}, which uses a completely different codepath, one which does a selective recursive scan by pattern matching as it goes down, filtering out those patterns which don't match. Cost is O(matching-directories) + cost of examining the files.
> It should be possible to do the glob status listing in S3A not through the filtered treewalk, but through a list + filter operation. This would be an O(files) lookup *before any filtering took place*.



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

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