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

Method DestroyPage

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

Source from the content-addressed store, hash-verified

155}
156
157void BufferPool::DestroyPage(ClientHandle* client, PageHandle* handle) {
158 if (!handle->is_open()) return; // DestroyPage() should be idempotent.
159
160 if (handle->is_pinned()) {
161 // Cancel the read I/O - we don't need the data any more.
162 if (handle->page_->pin_in_flight.Load()) {
163 handle->page_->write_handle->CancelRead();
164 handle->page_->pin_in_flight.Store(false);
165 }
166 // In the pinned case, delegate to ExtractBuffer() and FreeBuffer() to do the work
167 // of cleaning up the page, freeing the buffer and updating reservations correctly.
168 BufferHandle buffer;
169 Status status = ExtractBuffer(client, handle, &buffer);
170 DCHECK(status.ok()) << status.msg().msg();
171 FreeBuffer(client, &buffer);
172 } else {
173 // In the unpinned case, no reservations are used so we just clean up the page.
174 client->impl_->DestroyPageInternal(handle);
175 }
176}
177
178Status BufferPool::Pin(ClientHandle* client, PageHandle* handle) {
179 DCHECK(client->is_registered());

Callers 7

CloseMethod · 0.80
CloseMethod · 0.80
DestroyAllMethod · 0.80
TEST_FFunction · 0.80
CreatePageLoopMethod · 0.80
TestMemoryReclamationMethod · 0.80

Calls 7

CancelReadMethod · 0.80
DestroyPageInternalMethod · 0.80
is_openMethod · 0.45
is_pinnedMethod · 0.45
LoadMethod · 0.45
StoreMethod · 0.45
okMethod · 0.45

Tested by 5

DestroyAllMethod · 0.64
TEST_FFunction · 0.64
CreatePageLoopMethod · 0.64
TestMemoryReclamationMethod · 0.64