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

Method PrepareForReadWrite

be/src/runtime/buffered-tuple-stream.cc:242–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240}
241
242Status BufferedTupleStream::PrepareForReadWrite(
243 bool attach_on_read, bool* got_reservation) {
244 // This must be the first iterator created.
245 DCHECK(pages_.empty());
246 DCHECK(!read_it_.attach_on_read_);
247 DCHECK(!has_write_iterator());
248 DCHECK(!has_read_iterator());
249 CHECK_CONSISTENCY_FULL(read_it_);
250
251 *got_reservation = buffer_pool_client_->IncreaseReservationToFit(2 * default_page_len_);
252 if (!*got_reservation) return Status::OK();
253 has_write_iterator_ = true;
254 // Save reservation for both the read and write iterators.
255 buffer_pool_client_->SaveReservation(&read_page_reservation_, default_page_len_);
256 buffer_pool_client_->SaveReservation(&write_page_reservation_, default_page_len_);
257 RETURN_IF_ERROR(PrepareForReadInternal(attach_on_read, &read_it_));
258 return Status::OK();
259}
260
261void BufferedTupleStream::Close(RowBatch* batch, FlushMode flush) {
262 for (Page& page : pages_) {

Callers 10

OpenMethod · 0.80
TestUnpinPinMethod · 0.80
TestTransferMemoryMethod · 0.80
TEST_FFunction · 0.80
OpenMethod · 0.80

Calls 4

OKFunction · 0.85
SaveReservationMethod · 0.80
emptyMethod · 0.45

Tested by 8

TestUnpinPinMethod · 0.64
TestTransferMemoryMethod · 0.64
TEST_FFunction · 0.64