| 711 | } |
| 712 | |
| 713 | Status DiskIoMgr::ValidateScanRange(ScanRange* range) { |
| 714 | int disk_id = range->disk_id(); |
| 715 | if (disk_id < 0 || disk_id >= disk_queues_.size()) { |
| 716 | return Status(TErrorCode::DISK_IO_ERROR, GetBackendString(), |
| 717 | Substitute("Invalid scan range. Bad disk id: $0", disk_id)); |
| 718 | } |
| 719 | if (range->offset() < 0) { |
| 720 | return Status(TErrorCode::DISK_IO_ERROR, GetBackendString(), |
| 721 | Substitute("Invalid scan range. Negative offset $0", range->offset())); |
| 722 | } |
| 723 | if (range->len() <= 0) { |
| 724 | return Status(TErrorCode::DISK_IO_ERROR, GetBackendString(), |
| 725 | Substitute("Invalid scan range. Non-positive length $0", range->len())); |
| 726 | } |
| 727 | if (range->bytes_to_read() <= 0) { |
| 728 | return Status(TErrorCode::DISK_IO_ERROR, GetBackendString(), |
| 729 | Substitute("Invalid scan range. Non-positive bytes to read $0", |
| 730 | range->bytes_to_read())); |
| 731 | } |
| 732 | return Status::OK(); |
| 733 | } |
| 734 | |
| 735 | Status DiskIoMgr::AllocateBuffersForRange( |
| 736 | BufferPool::ClientHandle* bp_client, ScanRange* range, int64_t max_bytes) { |
no test coverage detected