| 357 | } |
| 358 | |
| 359 | bool |
| 360 | Config::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 | |
| 379 | void |
| 380 | Config::sizeCacheAdd(std::string_view url, uint64_t size) |