| 295 | bool BufferReader::supports_zero_copy() const { return true; } |
| 296 | |
| 297 | Status BufferReader::WillNeed(const std::vector<ReadRange>& ranges) { |
| 298 | using ::arrow::internal::MemoryRegion; |
| 299 | |
| 300 | RETURN_NOT_OK(CheckClosed()); |
| 301 | |
| 302 | std::vector<MemoryRegion> regions(ranges.size()); |
| 303 | for (size_t i = 0; i < ranges.size(); ++i) { |
| 304 | const auto& range = ranges[i]; |
| 305 | ARROW_ASSIGN_OR_RAISE(auto size, |
| 306 | internal::ValidateReadRange(range.offset, range.length, size_)); |
| 307 | regions[i] = {const_cast<uint8_t*>(data_ + range.offset), static_cast<size_t>(size)}; |
| 308 | } |
| 309 | const auto st = ::arrow::internal::MemoryAdviseWillNeed(regions); |
| 310 | if (st.IsIOError()) { |
| 311 | // Ignore any system-level errors, in case the memory area isn't madvise()-able |
| 312 | return Status::OK(); |
| 313 | } |
| 314 | return st; |
| 315 | } |
| 316 | |
| 317 | Future<std::shared_ptr<Buffer>> BufferReader::ReadAsync(const IOContext&, |
| 318 | int64_t position, |
nothing calls this directly
no test coverage detected