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

Method setOption

fdbclient/ThreadSafeTransaction.cpp:62–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62void ThreadSafeDatabase::setOption(FDBDatabaseOptions::Option option, Optional<StringRef> value) {
63 auto itr = FDBDatabaseOptions::optionInfo.find(option);
64 if (itr != FDBDatabaseOptions::optionInfo.end()) {
65 TraceEvent("SetDatabaseOption").detail("Option", itr->second.name);
66 } else {
67 TraceEvent("UnknownDatabaseOption").detail("Option", option);
68 throw invalid_option();
69 }
70 if (itr->first == FDBDatabaseOptions::USE_CONFIG_DATABASE) {
71 isConfigDB = true;
72 }
73
74 DatabaseContext* db = this->db;
75 Standalone<Optional<StringRef>> passValue = value;
76
77 // ThreadSafeDatabase is not allowed to do anything with options except pass them through to RYW.
78 onMainThreadVoid(
79 [db, option, passValue]() {
80 db->checkDeferredError();
81 db->setOption(option, passValue.contents());
82 },
83 db,
84 &DatabaseContext::deferredError);
85}
86
87ThreadFuture<int64_t> ThreadSafeDatabase::rebootWorker(const StringRef& address, bool check, int duration) {
88 DatabaseContext* db = this->db;

Callers

nothing calls this directly

Calls 7

TraceEventClass · 0.85
onMainThreadVoidFunction · 0.85
detailMethod · 0.80
setOptionMethod · 0.65
findMethod · 0.45
endMethod · 0.45
checkDeferredErrorMethod · 0.45

Tested by

no test coverage detected