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

Method OpenInputReader

cpp/src/arrow/filesystem/mockfs.cc:417–430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

415 }
416
417 Result<std::shared_ptr<io::BufferReader>> OpenInputReader(const std::string& path) {
418 ARROW_RETURN_NOT_OK(internal::AssertNoTrailingSlash(path));
419 auto parts = SplitAbstractPath(path);
420 RETURN_NOT_OK(ValidateAbstractPathParts(parts));
421
422 Entry* entry = FindEntry(parts);
423 if (entry == nullptr) {
424 return PathNotFound(path);
425 }
426 if (!entry->is_file()) {
427 return NotAFile(path);
428 }
429 return std::make_shared<MockFSInputStream>(entry->as_file());
430 }
431};
432
433MockFileSystem::~MockFileSystem() = default;

Callers 2

OpenInputStreamMethod · 0.80
OpenInputFileMethod · 0.80

Calls 6

AssertNoTrailingSlashFunction · 0.85
SplitAbstractPathFunction · 0.85
is_fileMethod · 0.80
PathNotFoundFunction · 0.70
NotAFileFunction · 0.70

Tested by

no test coverage detected