| 80 | |
| 81 | |
| 82 | Status HdfsScanNode::GetNext(RuntimeState* state, RowBatch* row_batch, bool* eos) { |
| 83 | SCOPED_TIMER(runtime_profile_->total_time_counter()); |
| 84 | ScopedGetNextEventAdder ea(this, eos); |
| 85 | |
| 86 | if (!initial_ranges_issued_.Load()) { |
| 87 | // We do this in GetNext() to maximise the amount of work we can do while waiting for |
| 88 | // runtime filters to show up. The scanner threads have already started (in Open()), |
| 89 | // so we need to tell them there is work to do. |
| 90 | // TODO: This is probably not worth splitting the organisational cost of splitting |
| 91 | // initialisation across two places. Move to before the scanner threads start. |
| 92 | Status status = IssueInitialScanRanges(state); |
| 93 | if (!status.ok()) { |
| 94 | // If the status returned is CANCELLED, it could be because the |
| 95 | // reader_context_ was cancelled by a scanner thread which hit an error. In this |
| 96 | // case, the scanner thread's error must take precedence. In other cases, |
| 97 | // the non-ok status represents the error in ValidateScanRange() or describes |
| 98 | // the unsupported compression formats. For such non-CANCELLED cases, the status |
| 99 | // returned by IssueInitialScanRanges() takes precedence. |
| 100 | unique_lock<timed_mutex> l(lock_); |
| 101 | if (status.IsCancelled() && !status_.ok()) return status_; |
| 102 | return status; |
| 103 | } |
| 104 | |
| 105 | // Release the scanner threads |
| 106 | discard_result(ranges_issued_barrier_.Notify()); |
| 107 | |
| 108 | if (shared_state_->progress().done()) SetDone(); |
| 109 | } |
| 110 | |
| 111 | Status status = GetNextInternal(state, row_batch, eos); |
| 112 | if (!status.ok() || *eos) { |
| 113 | unique_lock<timed_mutex> l(lock_); |
| 114 | lock_guard<SpinLock> l2(file_type_counts_lock_); |
| 115 | StopAndFinalizeCounters(); |
| 116 | } |
| 117 | return status; |
| 118 | } |
| 119 | |
| 120 | Status HdfsScanNode::GetNextInternal( |
| 121 | RuntimeState* state, RowBatch* row_batch, bool* eos) { |
nothing calls this directly
no test coverage detected