| 60 | } |
| 61 | |
| 62 | void 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 | |
| 87 | ThreadFuture<int64_t> ThreadSafeDatabase::rebootWorker(const StringRef& address, bool check, int duration) { |
| 88 | DatabaseContext* db = this->db; |
nothing calls this directly
no test coverage detected