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

Method loadSpan

src/traffic_cache_tool/CacheTool.cc:456–473  ·  view source on GitHub ↗

--------------------------------------------------------------------------------------- */

Source from the content-addressed store, hash-verified

454}
455/* --------------------------------------------------------------------------------------- */
456Errata
457Cache::loadSpan(swoc::file::path const &path)
458{
459 Errata zret;
460 std::error_code ec;
461 auto fs = swoc::file::status(path, ec);
462
463 if (path.empty()) {
464 zret = Errata(make_errno_code(EINVAL), "A span file specified by --spans is required");
465 } else if (!swoc::file::is_readable(path)) {
466 zret = Errata(make_errno_code(EPERM), R"("{}" is not readable.)", path);
467 } else if (swoc::file::is_regular_file(fs)) {
468 zret = this->loadSpanConfig(path);
469 } else {
470 zret = this->loadSpanDirect(path);
471 }
472 return zret;
473}
474
475Errata
476Cache::loadSpanDirect(swoc::file::path const &path, int vol_idx, [[maybe_unused]] const Bytes &size)

Callers 11

loadSpanConfigMethod · 0.95
loadMethod · 0.80
List_StripesFunction · 0.80
Clear_SpansFunction · 0.80
Find_StripeFunction · 0.80
dir_checkFunction · 0.80
walk_bucket_chainFunction · 0.80
Clear_SpanFunction · 0.80
Check_FreelistFunction · 0.80
Get_ResponseFunction · 0.80
Scan_CacheFunction · 0.80

Calls 8

loadSpanConfigMethod · 0.95
loadSpanDirectMethod · 0.95
statusFunction · 0.85
ErrataClass · 0.85
make_errno_codeFunction · 0.85
is_readableFunction · 0.85
is_regular_fileFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected