| 329 | } |
| 330 | |
| 331 | int64_t HdfsFileReader::ReadDataCache(DataCache* remote_data_cache, int64_t file_offset, |
| 332 | uint8_t* buffer, int64_t bytes_to_read) { |
| 333 | int64_t cached_read = remote_data_cache->Lookup(*scan_range_->file_string(), |
| 334 | scan_range_->mtime(), file_offset, bytes_to_read, buffer); |
| 335 | if (LIKELY(cached_read > 0)) { |
| 336 | scan_range_->reader_->data_cache_hit_bytes_counter_->Add(cached_read); |
| 337 | if (LIKELY(cached_read == bytes_to_read)) { |
| 338 | scan_range_->reader_->data_cache_hit_counter_->Add(1); |
| 339 | } else { |
| 340 | scan_range_->reader_->data_cache_partial_hit_counter_->Add(1); |
| 341 | } |
| 342 | ImpaladMetrics::IO_MGR_REMOTE_DATA_CACHE_HIT_BYTES->Increment(cached_read); |
| 343 | ImpaladMetrics::IO_MGR_REMOTE_DATA_CACHE_HIT_COUNT->Increment(1); |
| 344 | } |
| 345 | return cached_read; |
| 346 | } |
| 347 | |
| 348 | void HdfsFileReader::WriteDataCache(DataCache* remote_data_cache, int64_t file_offset, |
| 349 | const uint8_t* buffer, int64_t buffer_len, int64_t bytes_missed) { |
nothing calls this directly
no test coverage detected