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

Method load_key

plugins/experimental/txn_box/plugin/src/Extractor.cc:205–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203}
204
205auto
206FeatureGroup::load_key(Config &cfg, FeatureGroup::Tracking &tracking, swoc::TextView name) -> Rv<Tracking::Info *>
207{
208 YAML::Node n{tracking._node[name]};
209
210 // Check if the key is present in the node. If not, it must be a referenced key because
211 // the presence of explicit keys is checked before loading any keys.
212 if (!n) {
213 return Errata(S_ERROR, R"("{}" is referenced but no such key was found.)", name);
214 }
215
216 auto tinfo = tracking.obtain(name);
217
218 if (tinfo->_mark == DONE) { // already loaded, presumably due to a reference.
219 return tinfo;
220 }
221
222 if (tinfo->_mark == IN_PLAY) {
223 return Errata(S_ERROR, R"(Circular dependency for key "{}" at {}.)", name, tracking._node.Mark());
224 }
225 tinfo->_mark = IN_PLAY;
226
227 Errata errata{this->load_expr(cfg, tracking, tinfo, n)};
228 if (!errata.is_ok()) {
229 errata.note(R"(While loading extraction format for key "{}" at {}.)", name, tracking._node.Mark());
230 return errata;
231 }
232
233 tinfo->_mark = DONE;
234 return tinfo;
235}
236
237Errata
238FeatureGroup::load(Config &cfg, YAML::Node const &node, std::initializer_list<FeatureGroup::Descriptor> const &ex_keys)

Callers 2

loadMethod · 0.95
load_specMethod · 0.80

Calls 6

load_exprMethod · 0.95
ErrataClass · 0.85
obtainMethod · 0.80
MarkMethod · 0.45
is_okMethod · 0.45
noteMethod · 0.45

Tested by

no test coverage detected