| 536 | } |
| 537 | |
| 538 | void HdfsScanNode::SetDoneInternal(const Status& status) { |
| 539 | // If the scan node is already in the done state, do nothing. |
| 540 | if (done()) return; |
| 541 | DCHECK(status_.ok()); |
| 542 | done_.Store(true); |
| 543 | if (!status.ok()) status_ = status; |
| 544 | // TODO: Cancelling the RequestContext will wait on in-flight IO. We should |
| 545 | // investigate dropping the lock_ or restructuring this cancel. |
| 546 | if (reader_context_ != nullptr) reader_context_->Cancel(); |
| 547 | thread_state_.Shutdown(); |
| 548 | } |
| 549 | |
| 550 | void HdfsScanNode::SetDone() { |
| 551 | unique_lock<timed_mutex> l(lock_); |