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

Method isKnownLargeObj

plugins/slice/Config.cc:359–377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

357}
358
359bool
360Config::isKnownLargeObj(std::string_view url)
361{
362 if (m_min_size_to_slice <= 0) {
363 // If conditional slicing is not set, all objects are large enough to slice
364 return true;
365 }
366
367 assert(m_oscache.has_value()); // object size cache is always present when conditionally slicing
368 std::optional<uint64_t> size = m_oscache->get(url);
369 if (size.has_value()) {
370 DEBUG_LOG("Found url in cache: %.*s -> %" PRIu64, static_cast<int>(url.size()), url.data(), size.value());
371 if (size.value() >= m_min_size_to_slice) {
372 return true;
373 }
374 }
375
376 return false;
377}
378
379void
380Config::sizeCacheAdd(std::string_view url, uint64_t size)

Callers 1

should_skip_this_objFunction · 0.80

Calls 5

has_valueMethod · 0.45
getMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected