| 703 | } |
| 704 | |
| 705 | void ScanRange::CloseReader(const unique_lock<mutex>& scan_range_lock) { |
| 706 | if (all_buffers_returned(scan_range_lock) && |
| 707 | buffer_manager_->num_buffers_in_reader() == 0) { |
| 708 | // Close the readers if there are no more buffers in the reader and no more buffers |
| 709 | // will be returned to readers in future. Close() is idempotent so it is ok to call |
| 710 | // multiple times during cleanup so long as the range is actually finished. |
| 711 | if (!use_local_buffer_) { |
| 712 | file_reader_->Close(); |
| 713 | } else { |
| 714 | local_buffer_reader_->Close(); |
| 715 | } |
| 716 | } |
| 717 | } |
| 718 | |
| 719 | BufferDescriptor::BufferDescriptor(ScanRange* scan_range, |
| 720 | uint8_t* buffer, int64_t buffer_len) |
no test coverage detected