| 1052 | |
| 1053 | template <class T> |
| 1054 | void 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 | |
| 1072 | void rollback(StorageCacheData* data, Version rollbackVersion, Version nextVersion) { |
| 1073 | CODE_PROBE(true, "call to cacheRange rollback"); |
no test coverage detected