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

Method ReadAt

cpp/src/arrow/filesystem/gcsfs.cc:293–300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291 // @name RandomAccessFile
292 Result<int64_t> GetSize() override { return metadata_.size(); }
293 Result<int64_t> ReadAt(int64_t position, int64_t nbytes, void* out) override {
294 if (closed()) return Status::Invalid("Cannot read from closed file");
295 std::shared_ptr<io::InputStream> stream;
296 ARROW_ASSIGN_OR_RAISE(stream, factory_(gcs::Generation(metadata_.generation()),
297 gcs::ReadRange(position, position + nbytes),
298 gcs::ReadFromOffset()));
299 return stream->Read(nbytes, out);
300 }
301 Result<std::shared_ptr<Buffer>> ReadAt(int64_t position, int64_t nbytes) override {
302 if (closed()) return Status::Invalid("Cannot read from closed file");
303 std::shared_ptr<io::InputStream> stream;

Callers

nothing calls this directly

Calls 5

closedFunction · 0.85
InvalidFunction · 0.50
ARROW_ASSIGN_OR_RAISEFunction · 0.50
ReadRangeClass · 0.50
ReadMethod · 0.45

Tested by

no test coverage detected