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

Function getStorageInfo

fdbserver/ApplyMetadataMutation.cpp:36–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34#include "flow/Trace.h"
35
36Reference<StorageInfo> getStorageInfo(UID id,
37 std::map<UID, Reference<StorageInfo>>* storageCache,
38 IKeyValueStore* txnStateStore) {
39 Reference<StorageInfo> storageInfo;
40 auto cacheItr = storageCache->find(id);
41 if (cacheItr == storageCache->end()) {
42 storageInfo = makeReference<StorageInfo>();
43 storageInfo->tag = decodeServerTagValue(txnStateStore->readValue(serverTagKeyFor(id)).get().get());
44 storageInfo->interf = decodeServerListValue(txnStateStore->readValue(serverListKeyFor(id)).get().get());
45 (*storageCache)[id] = storageInfo;
46 } else {
47 storageInfo = cacheItr->second;
48 }
49 return storageInfo;
50}
51namespace {
52
53// It is incredibly important that any modifications to txnStateStore are done in such a way that the same operations

Calls 8

decodeServerTagValueFunction · 0.85
serverTagKeyForFunction · 0.85
decodeServerListValueFunction · 0.85
serverListKeyForFunction · 0.85
getMethod · 0.65
findMethod · 0.45
endMethod · 0.45
readValueMethod · 0.45

Tested by

no test coverage detected