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

Method addOpenFileInfo

bolt/common/caching/CacheTTLController.cpp:38–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36std::unique_ptr<CacheTTLController> CacheTTLController::instance_ = nullptr;
37
38bool CacheTTLController::addOpenFileInfo(
39 uint64_t fileNum,
40 int64_t openTimeSec) {
41 auto lockedFileMap = fileInfoMap_.wlock();
42 auto it = lockedFileMap->find(fileNum);
43 if (it == lockedFileMap->end() || it->second.removeInProgress) {
44 lockedFileMap->insert_or_assign(fileNum, RawFileInfo{openTimeSec, false});
45 return true;
46 }
47 return false;
48}
49
50CacheAgeStats CacheTTLController::getCacheAgeStats() const {
51 auto lockedFileMap = fileInfoMap_.rlock();

Callers 3

prepareSplitMethod · 0.80
TEST_FFunction · 0.80
loadNFilesMethod · 0.80

Calls 2

findMethod · 0.45
endMethod · 0.45

Tested by 2

TEST_FFunction · 0.64
loadNFilesMethod · 0.64