| 862 | } |
| 863 | |
| 864 | void AsyncDataCache::incrementNew(uint64_t size) { |
| 865 | newBytes_ += size; |
| 866 | if (ssdCache_ == nullptr) { |
| 867 | return; |
| 868 | } |
| 869 | if (newBytes_ > nextSsdScoreSize_) { |
| 870 | // Check next time after replacing half the cache. |
| 871 | nextSsdScoreSize_ = newBytes_ + |
| 872 | std::max<int64_t>(memory::AllocationTraits::pageBytes(cachedPages_), |
| 873 | 1UL << 28); |
| 874 | ssdCache_->groupStats().updateSsdFilter(ssdCache_->maxBytes() * 0.9); |
| 875 | } |
| 876 | } |
| 877 | |
| 878 | void AsyncDataCache::possibleSsdSave(uint64_t bytes) { |
| 879 | constexpr int32_t kMinSavePages = 4096; // Save at least 16MB at a time. |
no test coverage detected