| 264 | } |
| 265 | |
| 266 | void initApplyMutations(Reference<ReadYourWritesTransaction> tr, Key addPrefix, Key removePrefix) { |
| 267 | // Set these because they have to match the applyMutations values. |
| 268 | this->addPrefix().set(tr, addPrefix); |
| 269 | this->removePrefix().set(tr, removePrefix); |
| 270 | |
| 271 | clearApplyMutationsKeys(tr); |
| 272 | |
| 273 | // Initialize add/remove prefix, range version map count and set the map's start key to InvalidVersion |
| 274 | tr->set(uidPrefixKey(applyMutationsAddPrefixRange.begin, uid), addPrefix); |
| 275 | tr->set(uidPrefixKey(applyMutationsRemovePrefixRange.begin, uid), removePrefix); |
| 276 | int64_t startCount = 0; |
| 277 | tr->set(uidPrefixKey(applyMutationsKeyVersionCountRange.begin, uid), StringRef((uint8_t*)&startCount, 8)); |
| 278 | Key mapStart = uidPrefixKey(applyMutationsKeyVersionMapRange.begin, uid); |
| 279 | tr->set(mapStart, BinaryWriter::toValue<Version>(invalidVersion, Unversioned())); |
| 280 | } |
| 281 | |
| 282 | void clearApplyMutationsKeys(Reference<ReadYourWritesTransaction> tr) { |
| 283 | tr->setOption(FDBTransactionOptions::COMMIT_ON_FIRST_PROXY); |
no test coverage detected