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

Method GetFileInfoGenerator

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

Source from the content-addressed store, hash-verified

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