| 323 | } |
| 324 | |
| 325 | void TupleCacheMgr::UpdateWriteSize(TupleCacheMgr::Handle* handle, |
| 326 | size_t charge) { |
| 327 | uint8_t* data = getHandleData(cache_.get(), handle); |
| 328 | // We can only adjust the cache charge while an entry is IN_PROGRESS |
| 329 | DCHECK(TupleCacheState::IN_PROGRESS == GetState(handle)); |
| 330 | TupleCacheEntry* entry = reinterpret_cast<TupleCacheEntry*>(data); |
| 331 | int64_t diff = charge - entry->charge; |
| 332 | entry->charge = charge; |
| 333 | cache_->UpdateCharge(handle->cache_handle, charge); |
| 334 | if (diff < 0) { |
| 335 | DCHECK_LE(-diff, tuple_cache_outstanding_writes_bytes_->GetValue()); |
| 336 | } |
| 337 | tuple_cache_outstanding_writes_bytes_->Increment(diff); |
| 338 | } |
| 339 | |
| 340 | static Cache::UniquePendingHandle CreateEntry( |
| 341 | Cache* cache, const Slice& key, const string& path) { |
nothing calls this directly
no test coverage detected