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

Method getServerProtocol

fdbclient/MultiVersionTransaction.actor.cpp:600–612  ·  view source on GitHub ↗

Returns the protocol version reported by the coordinator this client is connected to If an expected version is given, the future won't return until the protocol version is different than expected Note: this will never return if the server is running a protocol from FDB 5.0 or older

Source from the content-addressed store, hash-verified

598// If an expected version is given, the future won't return until the protocol version is different than expected
599// Note: this will never return if the server is running a protocol from FDB 5.0 or older
600ThreadFuture<ProtocolVersion> DLDatabase::getServerProtocol(Optional<ProtocolVersion> expectedVersion) {
601 ASSERT(api->databaseGetServerProtocol != nullptr);
602
603 uint64_t expected =
604 expectedVersion.map<uint64_t>([](const ProtocolVersion& v) { return v.version(); }).orDefault(0);
605 FdbCApi::FDBFuture* f = api->databaseGetServerProtocol(db, expected);
606 return toThreadFuture<ProtocolVersion>(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) {
607 uint64_t pv;
608 FdbCApi::fdb_error_t error = api->futureGetUInt64(f, &pv);
609 ASSERT(!error);
610 return ProtocolVersion(pv);
611 });
612}
613
614ThreadFuture<Key> DLDatabase::purgeBlobGranules(const KeyRangeRef& keyRange, Version purgeVersion, bool force) {
615 if (!api->databasePurgeBlobGranules) {

Callers 1

Calls 1

orDefaultMethod · 0.45

Tested by

no test coverage detected