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

Method ExtractBuffer

be/src/runtime/bufferpool/buffer-pool.cc:215–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213}
214
215Status BufferPool::ExtractBuffer(
216 ClientHandle* client, PageHandle* page_handle, BufferHandle* buffer_handle) {
217 DCHECK(page_handle->is_pinned());
218 DCHECK(!buffer_handle->is_open());
219 DCHECK_EQ(page_handle->client_, client);
220
221 // If an async pin is in flight, we need to wait for it.
222 const BufferHandle* dummy;
223 RETURN_IF_ERROR(page_handle->GetBuffer(&dummy));
224
225 // Bring the pin count to 1 so that we're not using surplus reservations.
226 while (page_handle->pin_count() > 1) Unpin(client, page_handle);
227
228 // Destroy the page and extract the buffer.
229 client->impl_->DestroyPageInternal(page_handle, buffer_handle);
230 DCHECK(buffer_handle->is_open());
231 return Status::OK();
232}
233
234Status BufferPool::AllocateBuffer(
235 ClientHandle* client, int64_t len, BufferHandle* handle) {

Callers 1

TEST_FFunction · 0.45

Calls 6

OKFunction · 0.85
DestroyPageInternalMethod · 0.80
is_pinnedMethod · 0.45
is_openMethod · 0.45
GetBufferMethod · 0.45
pin_countMethod · 0.45

Tested by 1

TEST_FFunction · 0.36