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

Function splitMutation

fdbserver/StorageCache.actor.cpp:1054–1070  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1052
1053template <class T>
1054void splitMutation(StorageCacheData* data, KeyRangeMap<T>& map, MutationRef const& m, Version ver) {
1055 if (isSingleKeyMutation((MutationRef::Type)m.type)) {
1056 auto i = map.rangeContaining(m.param1);
1057 if (i->value()) // If this key lies in the cached key-range on this server
1058 data->addMutation(i->range(), ver, m);
1059 } else if (m.type == MutationRef::ClearRange) {
1060 KeyRangeRef mKeys(m.param1, m.param2);
1061 auto r = map.intersectingRanges(mKeys);
1062 for (auto i = r.begin(); i != r.end(); ++i) {
1063 if (i->value()) { // if this sub-range exists on this cache server
1064 KeyRangeRef k = mKeys & i->range();
1065 data->addMutation(i->range(), ver, MutationRef((MutationRef::Type)m.type, k.begin, k.end));
1066 }
1067 }
1068 } else
1069 ASSERT(false); // Unknown mutation type in splitMutations
1070}
1071
1072void rollback(StorageCacheData* data, Version rollbackVersion, Version nextVersion) {
1073 CODE_PROBE(true, "call to cacheRange rollback");

Callers 1

applyMutationMethod · 0.70

Calls 9

isSingleKeyMutationFunction · 0.85
MutationRefClass · 0.85
rangeContainingMethod · 0.80
intersectingRangesMethod · 0.80
valueMethod · 0.45
addMutationMethod · 0.45
rangeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected