MCPcopy Create free account
hub / github.com/apache/arrow / GetFileInfoGenerator

Method GetFileInfoGenerator

cpp/src/arrow/filesystem/s3fs.cc:2969–3000  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2967 }
2968
2969 FileInfoGenerator GetFileInfoGenerator(const FileSelector& select) {
2970 auto maybe_base_path = S3Path::FromString(select.base_dir);
2971 if (!maybe_base_path.ok()) {
2972 return MakeFailingGenerator<FileInfoVector>(maybe_base_path.status());
2973 }
2974 auto base_path = *std::move(maybe_base_path);
2975
2976 PushGenerator<std::vector<FileInfo>> generator;
2977 Future<> scheduler_fut = RunInScheduler(
2978 [select, base_path, sink = generator.producer()](
2979 util::AsyncTaskScheduler* scheduler, S3FileSystem::Impl* self) {
2980 if (base_path.empty()) {
2981 bool should_recurse = select.recursive && select.max_recursion > 0;
2982 self->FullListAsync(/*include_implicit_dirs=*/true, scheduler, sink,
2983 should_recurse);
2984 } else {
2985 self->ListAsync(select, base_path.bucket, base_path.key,
2986 /*include_implicit_dirs=*/true, scheduler, sink);
2987 }
2988 return Status::OK();
2989 });
2990
2991 // Mark the generator done once all tasks are finished
2992 scheduler_fut.AddCallback([sink = generator.producer()](const Status& st) mutable {
2993 if (!st.ok()) {
2994 sink.Push(st);
2995 }
2996 sink.Close();
2997 });
2998
2999 return generator;
3000 }
3001
3002 Status EnsureDirectoryExists(const S3Path& path) {
3003 if (!path.key.empty()) {

Callers 1

Calls 11

FullListAsyncMethod · 0.95
ListAsyncMethod · 0.95
FromStringFunction · 0.85
OKFunction · 0.50
okMethod · 0.45
statusMethod · 0.45
producerMethod · 0.45
emptyMethod · 0.45
AddCallbackMethod · 0.45
PushMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected