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

Method Load

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

Source from the content-addressed store, hash-verified

1076}
1077
1078Status DataCache::Partition::Load() {
1079 std::ifstream file;
1080 file.open(JoinPathSegments(path_, DUMP_FILE_NAME), std::ofstream::binary);
1081 if (!file) return Status::Expected(Substitute("Failed to open $0", DUMP_FILE_NAME));
1082 LOG(INFO) << Substitute("Partition $0 start loading.", index_);
1083 DumpData dump_data;
1084 try {
1085 dump_data.deserialize(file);
1086 } catch (boost::archive::archive_exception& e) {
1087 LOG(ERROR) << Substitute("Partition $0 failed to deserialize dump file.", index_)
1088 << e.what();
1089 return Status("Failed to deserialize dump file.");
1090 }
1091 file.close();
1092
1093 Status status = LoadCacheFiles(dump_data);
1094 if (!status.ok()) {
1095 cache_files_.clear();
1096 return status;
1097 }
1098
1099 status = LoadMetaCache(dump_data);
1100 if (!status.ok()) {
1101 cache_files_.clear();
1102 meta_cache_.reset(NewCache(GetCacheEvictionPolicy(FLAGS_data_cache_eviction_policy),
1103 capacity_, path_));
1104 // We have already successfully initialized meta_cache_ once before calling Load(), so
1105 // there is no reason for it to fail this time.
1106 ABORT_IF_ERROR(meta_cache_->Init());
1107 return status;
1108 }
1109
1110 LOG(INFO) << Substitute("Partition $0 load successfully.", index_);
1111 return Status::OK();
1112}
1113
1114Status DataCache::Partition::DumpCacheFiles(DumpData& dump_data) {
1115 lock_.DCheckLocked();

Callers 15

ToJsonMethod · 0.45
RegisterMethod · 0.45
UnRegisterCompletedMethod · 0.45
PageMethod · 0.45
buffer_reservationMethod · 0.45
file_groupMethod · 0.45
QueryStateClass · 0.45
IsCancelledMethod · 0.45
num_required_threadsMethod · 0.45
num_optional_threadsMethod · 0.45
optional_exceededMethod · 0.45
quotaMethod · 0.45

Calls 13

JoinPathSegmentsFunction · 0.85
SubstituteFunction · 0.85
NewCacheFunction · 0.85
GetCacheEvictionPolicyFunction · 0.85
OKFunction · 0.85
openMethod · 0.65
closeMethod · 0.65
clearMethod · 0.65
resetMethod · 0.65
StatusClass · 0.50
deserializeMethod · 0.45
okMethod · 0.45

Tested by 10

BytesAllocatedMethod · 0.36
TESTFunction · 0.36
SingleReaderTestBodyMethod · 0.36
TEST_FFunction · 0.36
CachedReadsTestBodyMethod · 0.36
WaitForAsyncWriteMethod · 0.36
LogUsageThreadFunction · 0.36
PinInFlightMethod · 0.36
TEST_FFunction · 0.36