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

Method parse

fdbclient/NativeAPI.actor.cpp:2750–2771  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2748}
2749
2750AddressExclusion AddressExclusion::parse(StringRef const& key) {
2751 // Must not change: serialized to the database!
2752 auto parsedIp = IPAddress::parse(key.toString());
2753 if (parsedIp.present()) {
2754 return AddressExclusion(parsedIp.get());
2755 }
2756
2757 // Not a whole machine, includes `port'.
2758 try {
2759 auto addr = NetworkAddress::parse(key.toString());
2760 if (addr.isTLS()) {
2761 TraceEvent(SevWarnAlways, "AddressExclusionParseError")
2762 .detail("String", key)
2763 .detail("Description", "Address inclusion string should not include `:tls' suffix.");
2764 return AddressExclusion();
2765 }
2766 return AddressExclusion(addr.ip, addr.port);
2767 } catch (Error&) {
2768 TraceEvent(SevWarnAlways, "AddressExclusionParseError").detail("String", key);
2769 return AddressExclusion();
2770 }
2771}
2772
2773Future<Optional<Value>> getValue(Reference<TransactionState> const& trState,
2774 Key const& key,

Callers

nothing calls this directly

Calls 8

AddressExclusionClass · 0.85
TraceEventClass · 0.85
isTLSMethod · 0.80
detailMethod · 0.80
parseFunction · 0.70
getMethod · 0.65
toStringMethod · 0.45
presentMethod · 0.45

Tested by

no test coverage detected