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

Method TryInit

be/src/runtime/sorter.cc:156–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154}
155
156Status Sorter::Run::TryInit(bool* allocation_failed) {
157 *allocation_failed = true;
158 DCHECK_GT(sorter_->inmem_run_max_pages_, 0);
159 // No need for additional copy page because var-len data is not reordered.
160 // The in-memory merger can copy var-len data directly from the in-memory runs,
161 // which are kept until the merge is finished
162 int num_to_create = 1 + has_var_len_slots_;
163 int64_t required_mem = num_to_create * sorter_->page_len_;
164 if (!sorter_->buffer_pool_client_->IncreaseReservationToFit(required_mem)) {
165 return Status::OK();
166 }
167
168 RETURN_IF_ERROR(AddPage(&fixed_len_pages_));
169 if (has_var_len_slots_) {
170 RETURN_IF_ERROR(AddPage(&var_len_pages_));
171 }
172 if (initial_run_) {
173 sorter_->initial_runs_counter_->Add(1);
174 }
175 *allocation_failed = false;
176 return Status::OK();
177}
178
179template <bool HAS_VAR_LEN_SLOTS, bool INITIAL_RUN>
180Status Sorter::Run::AddBatchInternal(

Callers 1

InitializeNewMinirunMethod · 0.80

Calls 3

OKFunction · 0.85
AddMethod · 0.45

Tested by

no test coverage detected