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

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

Given {{GlobFilter}} is a path filter, a naive implementation could use a 
variant of {{listFiles(recursive=true, filter=globFilter)}} —a variant as that 
method only lists files, not directories. We'd need a 
{{listFilesAndDirectories()}} or similar

This could eliminate the directory calls on deep trees, but be a performance 
killer on a wide bucket.  The glob scan should be designed to start as far down 
the tree as possible.

# Expand the patterns
# Identify the longest list of non-wildcard components in each pattern(s)
# do recursive listings under there if the pattern looks ilke it is designed to 
go down at least one child dir. If not, only go down /  (reduces size of return 
dataset)
# insert results in a sorted tree structure (avoids the sort afterwards)
# On later patterns, see if their paths have already been searched (is this 
possible?)


> 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
>
> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to