| 118 | } |
| 119 | |
| 120 | Status HdfsScanNode::GetNextInternal( |
| 121 | RuntimeState* state, RowBatch* row_batch, bool* eos) { |
| 122 | RETURN_IF_ERROR(ExecDebugAction(TExecNodePhase::GETNEXT, state)); |
| 123 | RETURN_IF_CANCELLED(state); |
| 124 | RETURN_IF_ERROR(QueryMaintenance(state)); |
| 125 | |
| 126 | if (ReachedLimitShared()) { |
| 127 | // LIMIT 0 case. Other limit values handled below. |
| 128 | DCHECK_EQ(limit_, 0); |
| 129 | *eos = true; |
| 130 | return Status::OK(); |
| 131 | } |
| 132 | *eos = false; |
| 133 | unique_ptr<RowBatch> materialized_batch = thread_state_.batch_queue()->GetBatch(); |
| 134 | if (materialized_batch != NULL) { |
| 135 | row_batch->AcquireState(materialized_batch.get()); |
| 136 | // Note that the scanner threads may have processed and queued up extra rows before |
| 137 | // this thread incremented the rows returned. |
| 138 | if (CheckLimitAndTruncateRowBatchIfNeededShared(row_batch, eos)) SetDone(); |
| 139 | COUNTER_SET(rows_returned_counter_, rows_returned_shared()); |
| 140 | materialized_batch.reset(); |
| 141 | return Status::OK(); |
| 142 | } |
| 143 | // The RowBatchQueue was shutdown either because all scan ranges are complete or a |
| 144 | // scanner thread encountered an error. Check status_ to distinguish those cases. |
| 145 | *eos = true; |
| 146 | unique_lock<timed_mutex> l(lock_); |
| 147 | return status_; |
| 148 | } |
| 149 | |
| 150 | Status HdfsScanNode::Prepare(RuntimeState* state) { |
| 151 | SCOPED_TIMER(runtime_profile_->total_time_counter()); |
nothing calls this directly
no test coverage detected