MCPcopy Create free account
hub / github.com/apache/impala / GetNext

Method GetNext

be/src/exec/kudu/kudu-scan-node.cc:85–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85Status KuduScanNode::GetNext(RuntimeState* state, RowBatch* row_batch, bool* eos) {
86 SCOPED_TIMER(runtime_profile_->total_time_counter());
87 ScopedGetNextEventAdder ea(this, eos);
88 RETURN_IF_ERROR(ExecDebugAction(TExecNodePhase::GETNEXT, state));
89 RETURN_IF_CANCELLED(state);
90 RETURN_IF_ERROR(QueryMaintenance(state));
91
92 // If there are no scan tokens, nothing is ever placed in the materialized
93 // row batch, so exit early for this case.
94 if (NumScanTokens() == 0 || ReachedLimitShared()) {
95 *eos = true;
96 return Status::OK();
97 }
98
99 *eos = false;
100 unique_ptr<RowBatch> materialized_batch = thread_state_.batch_queue()->GetBatch();
101 if (materialized_batch != NULL) {
102 row_batch->AcquireState(materialized_batch.get());
103 if (CheckLimitAndTruncateRowBatchIfNeededShared(row_batch, eos)) {
104 SetDone();
105 }
106 COUNTER_SET(rows_returned_counter_, rows_returned_shared());
107 materialized_batch.reset();
108 } else {
109 *eos = true;
110 }
111
112 unique_lock<mutex> l(lock_);
113 return status_;
114}
115
116void KuduScanNode::Close(RuntimeState* state) {
117 if (is_closed()) return;

Callers 1

ProcessScanTokenMethod · 0.45

Calls 7

OKFunction · 0.85
total_time_counterMethod · 0.80
batch_queueMethod · 0.80
AcquireStateMethod · 0.80
getMethod · 0.65
resetMethod · 0.65
GetBatchMethod · 0.45

Tested by

no test coverage detected