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

Method LoadMetaCache

be/src/runtime/io/data-cache.cc:1169–1193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1167}
1168
1169Status DataCache::Partition::LoadMetaCache(const DumpData& dump_data) {
1170 lock_.DCheckLocked();
1171 for (const DumpData::CacheKeyEntryData& key_entry : dump_data.meta_cache_data) {
1172 // Usually this shouldn't happen, and if it did, the dump file may be corrupted and
1173 // loading should be aborted.
1174 if (UNLIKELY(key_entry.index >= cache_files_.size())) {
1175 return Status("Failed to load meta cache, the dump file may be corrupted.");
1176 }
1177
1178 // According to the index, find the corresponding file pointer, build entry and insert
1179 // into the cache like normal store. If the cache capacity has been changed, the entry
1180 // may be evicted, but that's no matter.
1181 CacheFile* file = cache_files_[key_entry.index].get();
1182 CacheEntry entry(file, key_entry.offset, key_entry.len, key_entry.checksum);
1183 const int64_t charge_len = BitUtil::RoundUp(entry.len(), PAGE_SIZE);
1184 Cache::UniquePendingHandle pending_handle(
1185 meta_cache_->Allocate(Slice(key_entry.key), sizeof(CacheEntry), charge_len));
1186 if (UNLIKELY(pending_handle.get() == nullptr)) continue;
1187 memcpy(meta_cache_->MutableValue(&pending_handle), &entry, sizeof(CacheEntry));
1188 meta_cache_->Insert(std::move(pending_handle), this);
1189 ImpaladMetrics::IO_MGR_REMOTE_DATA_CACHE_TOTAL_BYTES->Increment(charge_len);
1190 ImpaladMetrics::IO_MGR_REMOTE_DATA_CACHE_NUM_ENTRIES->Increment(1);
1191 }
1192 return Status::OK();
1193}
1194
1195void DataCache::Partition::EvictedEntry(Slice key, Slice value) {
1196 if (closed_) return;

Callers

nothing calls this directly

Calls 12

moveFunction · 0.85
OKFunction · 0.85
DCheckLockedMethod · 0.80
getMethod · 0.65
StatusClass · 0.50
SliceClass · 0.50
sizeMethod · 0.45
lenMethod · 0.45
AllocateMethod · 0.45
MutableValueMethod · 0.45
InsertMethod · 0.45
IncrementMethod · 0.45

Tested by

no test coverage detected