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

Method makeConfigurationImmutable

fdbclient/DatabaseConfiguration.cpp:799–809  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

797}
798
799void DatabaseConfiguration::makeConfigurationImmutable() {
800 if (!mutableConfiguration.present())
801 return;
802 auto& mc = mutableConfiguration.get();
803 rawConfiguration = Standalone<VectorRef<KeyValueRef>>();
804 rawConfiguration.resize(rawConfiguration.arena(), mc.size());
805 int i = 0;
806 for (auto r = mc.begin(); r != mc.end(); ++r)
807 rawConfiguration[i++] = KeyValueRef(rawConfiguration.arena(), KeyValueRef(r->first, r->second));
808 mutableConfiguration = Optional<std::map<std::string, std::string>>();
809}
810
811void DatabaseConfiguration::fromKeyValues(Standalone<VectorRef<KeyValueRef>> rawConfig) {
812 resetInternal();

Callers 3

getExcludedServersMethod · 0.80
getExcludedLocalitiesMethod · 0.80
operator==Method · 0.80

Calls 7

getMethod · 0.65
KeyValueRefClass · 0.50
presentMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected