MCPcopy Create free account
hub / github.com/apache/impala / ReadDataCache

Method ReadDataCache

be/src/runtime/io/hdfs-file-reader.cc:331–346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331int64_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
348void HdfsFileReader::WriteDataCache(DataCache* remote_data_cache, int64_t file_offset,
349 const uint8_t* buffer, int64_t buffer_len, int64_t bytes_missed) {

Callers

nothing calls this directly

Calls 5

file_stringMethod · 0.80
LookupMethod · 0.45
mtimeMethod · 0.45
AddMethod · 0.45
IncrementMethod · 0.45

Tested by

no test coverage detected