Fully list all files from all buckets
| 2766 | |
| 2767 | // Fully list all files from all buckets |
| 2768 | void FullListAsync(bool include_implicit_dirs, util::AsyncTaskScheduler* scheduler, |
| 2769 | FileInfoSink sink, bool recursive) { |
| 2770 | scheduler->AddSimpleTask( |
| 2771 | [this, scheduler, sink, include_implicit_dirs, recursive]() mutable { |
| 2772 | return ListBucketsAsync().Then( |
| 2773 | [this, scheduler, sink, include_implicit_dirs, |
| 2774 | recursive](const std::vector<std::string>& buckets) mutable { |
| 2775 | // Return the buckets themselves as directories |
| 2776 | std::vector<FileInfo> buckets_as_directories = |
| 2777 | MakeDirectoryInfos(buckets); |
| 2778 | sink.Push(std::move(buckets_as_directories)); |
| 2779 | |
| 2780 | if (recursive) { |
| 2781 | // Recursively list each bucket (these will run in parallel but sink |
| 2782 | // should be thread safe and so this is ok) |
| 2783 | for (const auto& bucket : buckets) { |
| 2784 | FileSelector select; |
| 2785 | select.allow_not_found = true; |
| 2786 | select.recursive = true; |
| 2787 | select.base_dir = bucket; |
| 2788 | ListAsync(select, bucket, "", include_implicit_dirs, scheduler, sink); |
| 2789 | } |
| 2790 | } |
| 2791 | }); |
| 2792 | }, |
| 2793 | std::string_view("FullListBucketScan")); |
| 2794 | } |
| 2795 | |
| 2796 | // Delete multiple objects at once |
| 2797 | Future<> DeleteObjectsAsync(const std::string& bucket, |
no test coverage detected