Fully list all files from all buckets
| 2707 | |
| 2708 | // Fully list all files from all buckets |
| 2709 | void FullListAsync(bool include_implicit_dirs, util::AsyncTaskScheduler* scheduler, |
| 2710 | FileInfoSink sink, bool recursive) { |
| 2711 | scheduler->AddSimpleTask( |
| 2712 | [this, scheduler, sink, include_implicit_dirs, recursive]() mutable { |
| 2713 | return ListBucketsAsync().Then( |
| 2714 | [this, scheduler, sink, include_implicit_dirs, |
| 2715 | recursive](const std::vector<std::string>& buckets) mutable { |
| 2716 | // Return the buckets themselves as directories |
| 2717 | std::vector<FileInfo> buckets_as_directories = |
| 2718 | MakeDirectoryInfos(buckets); |
| 2719 | sink.Push(std::move(buckets_as_directories)); |
| 2720 | |
| 2721 | if (recursive) { |
| 2722 | // Recursively list each bucket (these will run in parallel but sink |
| 2723 | // should be thread safe and so this is ok) |
| 2724 | for (const auto& bucket : buckets) { |
| 2725 | FileSelector select; |
| 2726 | select.allow_not_found = true; |
| 2727 | select.recursive = true; |
| 2728 | select.base_dir = bucket; |
| 2729 | ListAsync(select, bucket, "", include_implicit_dirs, scheduler, sink); |
| 2730 | } |
| 2731 | } |
| 2732 | }); |
| 2733 | }, |
| 2734 | std::string_view("FullListBucketScan")); |
| 2735 | } |
| 2736 | |
| 2737 | // Delete multiple objects at once |
| 2738 | Future<> DeleteObjectsAsync(const std::string& bucket, |
no test coverage detected