MCPcopy Create free account
hub / github.com/apache/trafficserver / loadFromPersistentStore

Method loadFromPersistentStore

src/proxy/HostStatus.cc:163–183  ·  view source on GitHub ↗

loads host status persistent store file

Source from the content-addressed store, hash-verified

161
162// loads host status persistent store file
163void
164HostStatus::loadFromPersistentStore()
165{
166 YAML::Node records;
167 std::string fileStore = getHostStatusPersistentFilePath();
168 if (access(fileStore.c_str(), R_OK) == 0) {
169 try {
170 records = YAML::LoadFile(fileStore.c_str());
171 YAML::Node statusList = records["statuses"];
172 for (YAML::const_iterator it = statusList.begin(); it != statusList.end(); ++it) {
173 const YAML::Node &host = *it;
174 std::string hostName = host[HOST_NAME_KEY].as<std::string>();
175 std::string status = host[STATUS_KEY].as<std::string>();
176 HostStatRec h(std::move(status));
177 loadRecord(hostName, h);
178 }
179 } catch (std::exception const &ex) {
180 Warning("Error loading and decoding %s : %s", fileStore.c_str(), ex.what());
181 }
182 }
183}
184
185// loads in host status record.
186void

Callers 1

mainFunction · 0.80

Calls 5

LoadFileFunction · 0.85
c_strMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected