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

Method setOption

fdbcli/fdbcli.actor.cpp:159–173  ·  view source on GitHub ↗

Prints an error and throws invalid_option or invalid_option_value if the option could not be set

Source from the content-addressed store, hash-verified

157public:
158 // Prints an error and throws invalid_option or invalid_option_value if the option could not be set
159 void setOption(Reference<ITransaction> tr,
160 StringRef optionStr,
161 bool enabled,
162 Optional<StringRef> arg,
163 bool intrans) {
164 auto transactionItr = transactionOptions.legalOptions.find(optionStr.toString());
165 if (transactionItr != transactionOptions.legalOptions.end())
166 setTransactionOption(tr, transactionItr->second, enabled, arg, intrans);
167 else {
168 fprintf(stderr,
169 "ERROR: invalid option '%s'. Try `help options' for a list of available options.\n",
170 optionStr.toString().c_str());
171 throw invalid_option();
172 }
173 }
174
175 // Applies all enabled transaction options to the given transaction
176 void apply(Reference<ITransaction> tr) {

Callers

nothing calls this directly

Calls 5

fprintfFunction · 0.85
findMethod · 0.45
toStringMethod · 0.45
endMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected