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

Method ReadAt

cpp/src/arrow/ipc/reader.cc:2908–2921  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2906Result<int64_t> IoRecordedRandomAccessFile::GetSize() { return file_size_; }
2907
2908Result<int64_t> IoRecordedRandomAccessFile::ReadAt(int64_t position, int64_t nbytes,
2909 void* out) {
2910 auto num_bytes_read = std::min(file_size_, position + nbytes) - position;
2911
2912 if (!read_ranges_.empty() &&
2913 position == read_ranges_.back().offset + read_ranges_.back().length) {
2914 // merge continuous IOs into one if possible
2915 read_ranges_.back().length += num_bytes_read;
2916 } else {
2917 // no real IO is performed, it is only saved into a vector for replaying later
2918 read_ranges_.emplace_back(io::ReadRange{position, num_bytes_read});
2919 }
2920 return num_bytes_read;
2921}
2922
2923Result<std::shared_ptr<Buffer>> IoRecordedRandomAccessFile::ReadAt(int64_t position,
2924 int64_t nbytes) {

Callers 6

ReadBufferMethod · 0.45
ReadSparseCSFIndexFunction · 0.45
ReadFieldsSubsetFunction · 0.45
ReadMessageInternalFunction · 0.45
TESTFunction · 0.45
OpenMethod · 0.45

Calls 3

backMethod · 0.80
emplace_backMethod · 0.80
emptyMethod · 0.45

Tested by 1

TESTFunction · 0.36