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

Method set

fdbclient/NativeAPI.actor.cpp:5622–5638  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5620}
5621
5622void 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
5640void Transaction::atomicOp(const KeyRef& key,
5641 const ValueRef& operand,

Callers

nothing calls this directly

Calls 6

getMaxWriteKeySizeFunction · 0.85
singleKeyRangeFunction · 0.85
ValueRefClass · 0.85
emplace_backMethod · 0.80
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected