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

Method startWrite

bolt/common/caching/SsdCache.cpp:86–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86bool SsdCache::startWrite() {
87 if (isShutdown_) {
88 return false;
89 }
90 if (writesInProgress_.fetch_add(numShards_) == 0) {
91 // No write was pending, so now all shards are counted as writing.
92 return true;
93 }
94 // There were writes in progress, so compensate for the increment.
95 writesInProgress_.fetch_sub(numShards_);
96 return false;
97}
98
99void SsdCache::write(std::vector<CachePin> pins) {
100 BOLT_CHECK_LE(numShards_, writesInProgress_);

Callers 5

VectorStreamMethod · 0.45
clearMethod · 0.45
evictMethod · 0.45
possibleSsdSaveMethod · 0.45
DEBUG_ONLY_TEST_FFunction · 0.45

Calls

no outgoing calls

Tested by 1

DEBUG_ONLY_TEST_FFunction · 0.36