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

Method initApplyMutations

fdbclient/FileBackupAgent.actor.cpp:266–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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);

Callers 1

Calls 6

addPrefixMethod · 0.95
removePrefixMethod · 0.95
uidPrefixKeyFunction · 0.85
UnversionedFunction · 0.85
setMethod · 0.65
StringRefClass · 0.50

Tested by

no test coverage detected