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

Method initializeCache

bolt/common/caching/tests/SsdFileTest.cpp:72–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70 }
71
72 void initializeCache(
73 int64_t maxBytes,
74 int64_t ssdBytes = 0,
75 bool setNoCowFlag = false) {
76 // tmpfs does not support O_DIRECT, so turn this off for testing.
77 FLAGS_bolt_ssd_odirect = false;
78 cache_ = AsyncDataCache::create(memory::memoryManager()->allocator());
79
80 fileName_ = StringIdLease(fileIds(), "fileInStorage");
81
82 tempDirectory_ = exec::test::TempDirectoryPath::create();
83 ssdFile_ = std::make_unique<SsdFile>(
84 fmt::format("{}/ssdtest", tempDirectory_->path),
85 0, // shardId
86 bits::roundUp(ssdBytes, SsdFile::kRegionSize) / SsdFile::kRegionSize,
87 0, // checkpointInternalBytes
88 setNoCowFlag);
89 }
90
91 static void initializeContents(int64_t sequence, memory::Allocation& alloc) {
92 bool first = true;

Callers

nothing calls this directly

Calls 5

memoryManagerFunction · 0.85
StringIdLeaseClass · 0.85
roundUpFunction · 0.85
createFunction · 0.50
allocatorMethod · 0.45

Tested by

no test coverage detected