| 210 | |
| 211 | struct ScanBatchTask : public util::AsyncTaskScheduler::Task { |
| 212 | ScanBatchTask(ScanNode* node, ScanState* scan_state, int batch_index) |
| 213 | : node_(node), scan_(scan_state), batch_index_(batch_index) { |
| 214 | int64_t cost = scan_state->fragment_scanner->EstimatedDataBytes(batch_index_); |
| 215 | // It's possible, though probably a bad idea, for a single batch of a fragment |
| 216 | // to be larger than 2GiB. In that case, it doesn't matter much if we |
| 217 | // underestimate because the largest the throttle can be is 2GiB and thus we will |
| 218 | // be in "one batch at a time" mode anyways which is the best we can do in this |
| 219 | // case. |
| 220 | cost_ = static_cast<int>( |
| 221 | std::min(cost, static_cast<int64_t>(std::numeric_limits<int>::max()))); |
| 222 | name_ = "ScanNode::ScanBatch::" + ::arrow::internal::ToChars(batch_index_); |
| 223 | } |
| 224 | |
| 225 | Result<Future<>> operator()() override { |
| 226 | // Prevent concurrent calls to ScanBatch which might not be thread safe |
nothing calls this directly
no test coverage detected