MCPcopy Create free account
hub / github.com/apple/foundationdb / getOverriddenKnobKeyValues

Function getOverriddenKnobKeyValues

fdbserver/tester.actor.cpp:1406–1435  ·  view source on GitHub ↗

In the current TOML scope, look for "knobs" field. If exists, translate all key value pairs into KnobKeyValuePairs

Source from the content-addressed store, hash-verified

1404// In the current TOML scope, look for "knobs" field. If exists, translate all
1405// key value pairs into KnobKeyValuePairs
1406KnobKeyValuePairs getOverriddenKnobKeyValues(const toml::value& context) {
1407 KnobKeyValuePairs result;
1408
1409 try {
1410 const toml::array& overrideKnobs = toml::find(context, "knobs").as_array();
1411 for (const toml::value& knob : overrideKnobs) {
1412 for (const auto& [key, value_] : knob.as_table()) {
1413 const std::string& value = toml_to_string(value_);
1414 ParsedKnobValue parsedValue = CLIENT_KNOBS->parseKnobValue(key, value);
1415 if (std::get_if<NoKnobFound>(&parsedValue)) {
1416 parsedValue = SERVER_KNOBS->parseKnobValue(key, value);
1417 }
1418 if (std::get_if<NoKnobFound>(&parsedValue)) {
1419 parsedValue = FLOW_KNOBS->parseKnobValue(key, value);
1420 }
1421 if (std::get_if<NoKnobFound>(&parsedValue)) {
1422 TraceEvent(SevError, "TestSpecUnrecognizedKnob")
1423 .detail("KnobName", key)
1424 .detail("OverrideValue", value);
1425 continue;
1426 }
1427 result.set(key, parsedValue);
1428 }
1429 }
1430 } catch (const std::out_of_range&) {
1431 // No knobs field in this scope, this is not an error
1432 }
1433
1434 return result;
1435}
1436
1437} // namespace
1438

Callers 1

readTOMLTests_Function · 0.85

Calls 6

findFunction · 0.85
TraceEventClass · 0.85
detailMethod · 0.80
toml_to_stringFunction · 0.70
setMethod · 0.65
parseKnobValueMethod · 0.45

Tested by

no test coverage detected