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

Method Unpin

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

Source from the content-addressed store, hash-verified

192}
193
194void BufferPool::Unpin(ClientHandle* client, PageHandle* handle) {
195 DCHECK(handle->is_open());
196 DCHECK(client->is_registered());
197 DCHECK_EQ(handle->client_, client);
198 // If handle is pinned, we can assume that the page itself is pinned.
199 DCHECK(handle->is_pinned());
200 Page* page = handle->page_;
201 ReservationTracker* reservation = client->impl_->reservation();
202 reservation->ReleaseTo(page->len);
203
204 if (--page->pin_count > 0) return;
205 if (page->pin_in_flight.Load()) {
206 // Data is not in memory - move it back to evicted.
207 client->impl_->UndoMoveEvictedToPinned(page);
208 } else {
209 // Data is in memory - move it to dirty unpinned.
210 client->impl_->MoveToDirtyUnpinned(page);
211 }
212 COUNTER_ADD(client->impl_->counters().peak_unpinned_bytes, handle->len());
213}
214
215Status BufferPool::ExtractBuffer(
216 ClientHandle* client, PageHandle* page_handle, BufferHandle* buffer_handle) {

Callers 6

UnpinAllMethod · 0.45
TEST_FFunction · 0.45
CreatePageLoopMethod · 0.45
TestMemoryReclamationMethod · 0.45

Calls 9

is_registeredMethod · 0.80
ReleaseToMethod · 0.80
MoveToDirtyUnpinnedMethod · 0.80
is_openMethod · 0.45
is_pinnedMethod · 0.45
reservationMethod · 0.45
LoadMethod · 0.45
lenMethod · 0.45

Tested by 6

UnpinAllMethod · 0.36
TEST_FFunction · 0.36
CreatePageLoopMethod · 0.36
TestMemoryReclamationMethod · 0.36