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
| 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 |
| 600 | ThreadFuture<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 | |
| 614 | ThreadFuture<Key> DLDatabase::purgeBlobGranules(const KeyRangeRef& keyRange, Version purgeVersion, bool force) { |
| 615 | if (!api->databasePurgeBlobGranules) { |
no test coverage detected