| 388 | cache_.makePins( |
| 389 | keys_, |
| 390 | [&](int32_t index) { return sizes_[index]; }, |
| 391 | [&](int32_t /*index*/, CachePin pin) { |
| 392 | if (isPrefetch) { |
| 393 | pin.checkedEntry()->setPrefetch(true); |
| 394 | } |
| 395 | pins.push_back(std::move(pin)); |
| 396 | }, |
| 397 | false); |
| 398 | if (pins.empty()) { |
| 399 | return pins; |
| 400 | } |
| 401 | auto stats = cache::readPins( |
| 402 | pins, |
| 403 | maxCoalesceDistance_, |
| 404 | 1000, |
| 405 | [&](int32_t i) { return pins[i].entry()->offset(); }, |
| 406 | [&](const std::vector<CachePin>& /*pins*/, |
| 407 | int32_t /*begin*/, |
| 408 | int32_t /*end*/, |
| 409 | uint64_t offset, |
| 410 | const std::vector<folly::Range<char*>>& buffers) { |
| 411 | input_->read(buffers, offset, LogType::FILE); |
| 412 | }); |
| 413 | updateStats(stats, isPrefetch, false); |
| 414 | return pins; |
| 415 | } |
| 416 | |
| 417 | std::shared_ptr<ReadFileInputStream> input_; |
| 418 | const int32_t maxCoalesceDistance_; |
| 419 | }; |
| 420 | |
| 421 | // Represents a CoalescedLoad from local SSD cache. |
| 422 | class SsdLoad : public DwioCoalescedLoadBase { |
| 423 | public: |
nothing calls this directly
no test coverage detected