MCPcopy Create free account
hub / github.com/apache/trafficserver / load

Method load

src/traffic_cache_tool/CacheTool.cc:291–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289VolumeAllocator::VolumeAllocator() = default;
290
291Errata
292VolumeAllocator::load(swoc::file::path const &spanFile, swoc::file::path const &volumeFile)
293{
294 Errata zret;
295
296 if (volumeFile.empty()) {
297 zret.note("Volume config file not set");
298 }
299 if (spanFile.empty()) {
300 zret.note("Span file not set");
301 }
302
303 if (zret) {
304 zret = _vols.load(volumeFile);
305 if (zret) {
306 zret = _cache.loadSpan(spanFile);
307 if (zret) {
308 CacheStripeBlocks total = _cache.calcTotalSpanConfiguredSize();
309 _vols.convertToAbsolute(total);
310 for (auto &vol : _vols) {
311 CacheStripeBlocks size(0);
312 auto spot = _cache._volumes.find(vol._idx);
313 if (spot != _cache._volumes.end()) {
314 size = round_down(spot->second._size);
315 }
316 _av.push_back({vol, size, 0, 0});
317 }
318 }
319 }
320 }
321 return zret;
322}
323
324void
325VolumeAllocator::dumpVolumes()

Callers 6

set_debug_ipFunction · 0.45
try_loading_pluginFunction · 0.45
loadSpanDirectMethod · 0.45
Cmd_Allocate_Empty_SpansFunction · 0.45
Simulate_Span_AllocationFunction · 0.45
Init_diskFunction · 0.45

Calls 15

loadDeviceMethod · 0.95
round_downFunction · 0.85
statusFunction · 0.85
is_readableFunction · 0.85
ErrataClass · 0.85
make_errno_codeFunction · 0.85
is_char_deviceFunction · 0.85
is_block_deviceFunction · 0.85
is_dirFunction · 0.85
strcasecmpFunction · 0.85
svtoiFunction · 0.85
round_upFunction · 0.85

Tested by

no test coverage detected