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

Method getExcludedLocalities

fdbclient/DatabaseConfiguration.cpp:770–787  ·  view source on GitHub ↗

Gets the list of already excluded localities (with failed option)

Source from the content-addressed store, hash-verified

768
769// Gets the list of already excluded localities (with failed option)
770std::set<std::string> DatabaseConfiguration::getExcludedLocalities() const {
771 // TODO: revisit all const_cast usages
772 const_cast<DatabaseConfiguration*>(this)->makeConfigurationImmutable();
773 std::set<std::string> localities;
774 for (auto i = lower_bound(rawConfiguration, excludedLocalityKeys.begin);
775 i != rawConfiguration.end() && i->key < excludedLocalityKeys.end;
776 ++i) {
777 std::string l = decodeExcludedLocalityKey(i->key);
778 localities.insert(l);
779 }
780 for (auto i = lower_bound(rawConfiguration, failedLocalityKeys.begin);
781 i != rawConfiguration.end() && i->key < failedLocalityKeys.end;
782 ++i) {
783 std::string l = decodeFailedLocalityKey(i->key);
784 localities.insert(l);
785 }
786 return localities;
787}
788
789void DatabaseConfiguration::makeConfigurationMutable() {
790 if (mutableConfiguration.present())

Callers 1

configurationFetcherFunction · 0.80

Calls 6

decodeFailedLocalityKeyFunction · 0.85
lower_boundFunction · 0.70
endMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected