| 5715 | t.write_conflict_ranges.emplace_back(req.arena, KeyRef(data, key.size()), KeyRef(data, key.size() + 1)); |
| 5716 | } |
| 5717 | void Transaction::addWriteConflictRange(const KeyRangeRef& keys) { |
| 5718 | ASSERT(!keys.empty()); |
| 5719 | auto& req = tr; |
| 5720 | auto& t = req.transaction; |
| 5721 | |
| 5722 | // There aren't any keys in the database with size larger than the max key size, so if range contains large keys |
| 5723 | // we can translate it to an equivalent one with smaller keys |
| 5724 | KeyRef begin = keys.begin; |
| 5725 | KeyRef end = keys.end; |
| 5726 | |
| 5727 | int64_t beginMaxSize = getMaxKeySize(begin); |
| 5728 | int64_t endMaxSize = getMaxKeySize(end); |
| 5729 | if (begin.size() > beginMaxSize) { |
| 5730 | begin = begin.substr(0, beginMaxSize + 1); |
| 5731 | } |
| 5732 | if (end.size() > endMaxSize) { |
| 5733 | end = end.substr(0, endMaxSize + 1); |
| 5734 | } |
| 5735 | KeyRangeRef r = KeyRangeRef(begin, end); |
| 5736 | |
| 5737 | if (r.empty()) { |
| 5738 | return; |
| 5739 | } |
| 5740 | |
| 5741 | t.write_conflict_ranges.push_back_deep(req.arena, r); |
| 5742 | } |
| 5743 | |
| 5744 | double Transaction::getBackoff(int errCode) { |
| 5745 | double returnedBackoff = backoff; |
nothing calls this directly
no test coverage detected