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

Method loadVersion

fdbclient/MultiVersionTransaction.actor.cpp:2930–2948  ·  view source on GitHub ↗

ClientInfo

Source from the content-addressed store, hash-verified

2928
2929// ClientInfo
2930void ClientInfo::loadVersion() {
2931 std::string version = api->getClientVersion();
2932 if (version == "unknown") {
2933 protocolVersion = ProtocolVersion(0);
2934 releaseVersion = "unknown";
2935 return;
2936 }
2937
2938 Standalone<ClientVersionRef> clientVersion = ClientVersionRef(StringRef(version));
2939
2940 char* next;
2941 std::string protocolVersionStr = clientVersion.protocolVersion.toString();
2942 protocolVersion = ProtocolVersion(strtoull(protocolVersionStr.c_str(), &next, 16));
2943
2944 ASSERT(protocolVersion.version() != 0 && protocolVersion.version() != ULLONG_MAX);
2945 ASSERT_EQ(next, &protocolVersionStr[protocolVersionStr.length()]);
2946
2947 releaseVersion = clientVersion.clientVersion.toString();
2948}
2949
2950bool ClientInfo::canReplace(Reference<ClientInfo> other) const {
2951 if (protocolVersion > other->protocolVersion) {

Callers 1

setupNetworkMethod · 0.80

Calls 6

ClientVersionRefClass · 0.85
StringRefClass · 0.50
getClientVersionMethod · 0.45
toStringMethod · 0.45
c_strMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected