| 34 | #include "flow/Trace.h" |
| 35 | |
| 36 | Reference<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 | } |
| 51 | namespace { |
| 52 | |
| 53 | // It is incredibly important that any modifications to txnStateStore are done in such a way that the same operations |
no test coverage detected