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

Method tryParseKnobValue

fdbclient/TestKnobCollection.cpp:42–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42Optional<KnobValue> TestKnobCollection::tryParseKnobValue(std::string const& knobName,
43 std::string const& knobValue) const {
44 auto result = serverKnobCollection.tryParseKnobValue(knobName, knobValue);
45 if (result.present()) {
46 return result;
47 }
48 auto parsedKnobValue = testKnobs.parseKnobValue(knobName, knobValue);
49 if (!std::holds_alternative<NoKnobFound>(parsedKnobValue)) {
50 return KnobValueRef::create(parsedKnobValue);
51 }
52 return {};
53}
54
55bool TestKnobCollection::trySetKnob(std::string const& knobName, KnobValueRef const& knobValue) {
56 return serverKnobCollection.trySetKnob(knobName, knobValue) || knobValue.visitSetKnob(knobName, testKnobs);

Callers

nothing calls this directly

Calls 2

presentMethod · 0.45
parseKnobValueMethod · 0.45

Tested by

no test coverage detected