| 31 | } |
| 32 | |
| 33 | Future<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 | |
| 46 | std::string describeIndex(std::vector<std::pair<std::string, int>> indexKeys) { |
| 47 | std::string ret = "index: "; |
no test coverage detected