| 5620 | } |
| 5621 | |
| 5622 | void Transaction::set(const KeyRef& key, const ValueRef& value, AddConflictRange addConflictRange) { |
| 5623 | ++trState->cx->transactionSetMutations; |
| 5624 | if (key.size() > getMaxWriteKeySize(key, trState->options.rawAccess)) |
| 5625 | throw key_too_large(); |
| 5626 | if (value.size() > CLIENT_KNOBS->VALUE_SIZE_LIMIT) |
| 5627 | throw value_too_large(); |
| 5628 | |
| 5629 | auto& req = tr; |
| 5630 | auto& t = req.transaction; |
| 5631 | auto r = singleKeyRange(key, req.arena); |
| 5632 | auto v = ValueRef(req.arena, value); |
| 5633 | t.mutations.emplace_back(req.arena, MutationRef::SetValue, r.begin, v); |
| 5634 | |
| 5635 | if (addConflictRange) { |
| 5636 | t.write_conflict_ranges.push_back(req.arena, r); |
| 5637 | } |
| 5638 | } |
| 5639 | |
| 5640 | void Transaction::atomicOp(const KeyRef& key, |
| 5641 | const ValueRef& operand, |
nothing calls this directly
no test coverage detected