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

Method GetNext

be/src/exec/hdfs-scan-node.cc:82–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80
81
82Status 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
120Status HdfsScanNode::GetNextInternal(
121 RuntimeState* state, RowBatch* row_batch, bool* eos) {

Callers

nothing calls this directly

Calls 7

discard_resultFunction · 0.85
total_time_counterMethod · 0.80
LoadMethod · 0.45
okMethod · 0.45
IsCancelledMethod · 0.45
NotifyMethod · 0.45
doneMethod · 0.45

Tested by

no test coverage detected