MCPcopy Create free account
hub / github.com/FoundationDB/fdb-document-layer / getMetadataVersion

Function getMetadataVersion

src/MetadataManager.actor.cpp:33–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33Future<uint64_t> getMetadataVersion(Reference<DocTransaction> tr, Reference<DirectorySubspace> metadataDirectory) {
34 Standalone<StringRef> versionKey = metadataDirectory->key().withSuffix(
35 DataValue(DocLayerConstants::VERSION_KEY, DVTypeCode::STRING).encode_key_part());
36 Future<Optional<FDBStandalone<StringRef>>> fov = tr->tr->get(versionKey);
37 Future<uint64_t> ret = map(fov, [](Optional<FDBStandalone<StringRef>> ov) -> uint64_t {
38 if (!ov.present())
39 return 0;
40 else
41 return *((uint64_t*)(ov.get().begin()));
42 });
43 return ret;
44}
45
46std::string describeIndex(std::vector<std::pair<std::string, int>> indexKeys) {
47 std::string ret = "index: ";

Calls 4

DataValueClass · 0.85
encode_key_partMethod · 0.80
beginMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected