| 1193 | } |
| 1194 | |
| 1195 | void DataCache::Partition::EvictedEntry(Slice key, Slice value) { |
| 1196 | if (closed_) return; |
| 1197 | if (UNLIKELY(trace_replay_)) return; |
| 1198 | ScopedHistogramTimer eviction_timer(eviction_latency_); |
| 1199 | // Unpack the cache entry. |
| 1200 | CacheEntry entry(value); |
| 1201 | int64_t eviction_len = BitUtil::RoundUp(entry.len(), PAGE_SIZE); |
| 1202 | DCHECK_EQ(entry.offset() % PAGE_SIZE, 0); |
| 1203 | entry.file()->PunchHole(entry.offset(), eviction_len); |
| 1204 | ImpaladMetrics::IO_MGR_REMOTE_DATA_CACHE_TOTAL_BYTES->Increment(-eviction_len); |
| 1205 | ImpaladMetrics::IO_MGR_REMOTE_DATA_CACHE_NUM_ENTRIES->Increment(-1); |
| 1206 | } |
| 1207 | |
| 1208 | // TODO: Switch to using CRC32 once we fix the TODO in hash-util.h |
| 1209 | uint64_t DataCache::Partition::Checksum(const uint8_t* buffer, int64_t buffer_len) { |