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

Method loadRecord

src/proxy/HostStatus.cc:186–201  ·  view source on GitHub ↗

loads in host status record.

Source from the content-addressed store, hash-verified

184
185// loads in host status record.
186void
187HostStatus::loadRecord(std::string_view name, HostStatRec &h)
188{
189 HostStatRec *host_stat = nullptr;
190 Dbg(dbg_ctl_host_statuses, "loading host status record for %.*s", int(name.size()), name.data());
191 ink_rwlock_wrlock(&host_status_rwlock);
192 {
193 auto it = hosts_statuses.find(std::string(name));
194 if (it == hosts_statuses.end()) {
195 host_stat = static_cast<HostStatRec *>(ats_malloc(sizeof(HostStatRec)));
196 *host_stat = h;
197 hosts_statuses.emplace(name, host_stat);
198 }
199 }
200 ink_rwlock_unlock(&host_status_rwlock);
201}
202
203void
204HostStatus::setHostStatus(const std::string_view name, TSHostStatus status, const unsigned int down_time, const unsigned int reason)

Callers

nothing calls this directly

Calls 9

ink_rwlock_wrlockFunction · 0.85
stringClass · 0.85
ats_mallocFunction · 0.85
ink_rwlock_unlockFunction · 0.85
emplaceMethod · 0.80
sizeMethod · 0.45
dataMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected