| 354 | } |
| 355 | |
| 356 | bool ScanNode::ScannerThreadState::EnqueueBatchWithTimeout( |
| 357 | unique_ptr<RowBatch>* row_batch, int64_t timeout_micros) { |
| 358 | // Only need to count tuple_data_pool() bytes since after IMPALA-5307, no buffers are |
| 359 | // returned from the scan node. |
| 360 | int64_t bytes = (*row_batch)->tuple_data_pool()->total_reserved_bytes(); |
| 361 | // Transfer memory ownership before enqueueing. If the caller retries, this transfer |
| 362 | // is idempotent. |
| 363 | (*row_batch)->SetMemTracker(row_batches_mem_tracker_); |
| 364 | if (!batch_queue_->AddBatchWithTimeout(move(*row_batch), timeout_micros)) { |
| 365 | return false; |
| 366 | } |
| 367 | COUNTER_ADD(row_batches_enqueued_, 1); |
| 368 | COUNTER_ADD(row_batch_bytes_enqueued_, bytes); |
| 369 | return true; |
| 370 | } |
| 371 | |
| 372 | void ScanNode::ScannerThreadState::Shutdown() { |
| 373 | if (batch_queue_ != nullptr) batch_queue_->Shutdown(); |
no test coverage detected