MCPcopy Create free account
hub / github.com/bytedance/bolt / incrementNew

Method incrementNew

bolt/common/caching/AsyncDataCache.cpp:864–876  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

862}
863
864void 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
878void AsyncDataCache::possibleSsdSave(uint64_t bytes) {
879 constexpr int32_t kMinSavePages = 4096; // Save at least 16MB at a time.

Callers 1

initEntryMethod · 0.80

Calls 2

updateSsdFilterMethod · 0.80
maxBytesMethod · 0.80

Tested by

no test coverage detected