-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ARROW-17306: [C++] filesystem: LocalFileSystem: provide optimized ver…
…sion of `GetFileInfoGenerator` Introduce a helper class `AsyncStatSelector`, which contains an optimized specialization for `GetFileInfoGenerator` in the `LocalFileSystem` class. There are two variants of async discovery functions suported: 1. `DiscoverDirectoryFiles`, which parallelizes traversal of individual directories so that each directory results are yielded as a separate `FileInfoGenerator` via an underlying `DiscoveryImplIterator`, which delivers items in chunks (default size is `kDefaultBatchSize == 1K` items). 2. `DiscoverDirectoriesFlattened`, which forwards execution to the `DiscoverDirectoryFiles`, with the difference that the results from individual sub-directory iterators are merged into the single FileInfoGenerator stream. The implementation makes use of additional attributes in `LocalFileSystemOptions`, such as `directory_readahead`, which can be used to tune algorithm behavior and adjust how many directories can be processed in parallel. This option is disabled by default, so that individual directories are processed in serial manner via `MakeConcatenatedGenerator` under the hood. Also, internal batching can also be configured by `LocalFileSystemOptions::batch_size`, which specifies how many `FileInfo`:s should be batched into a single `FileInfoVector` to yield in a single `DirectoryImplIterator::Next()` invocation. Tests: unit(release) Signed-off-by: Pavel Solodovnikov <[email protected]> Co-Authored-by: Igor Seliverstov <[email protected]>
- Loading branch information
1 parent
c11121b
commit 136ae80
Showing
2 changed files
with
207 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters