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

Function versionStampKeyForIndex

fdbserver/workloads/WriteDuringRead.actor.cpp:716–723  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

714 }
715
716 Key versionStampKeyForIndex(int idx) {
717 Key result = KeyRef(getKeyForIndex(idx).toString() + std::string(14, '\x00'));
718 int32_t pos = deterministicRandom()->randomInt(0, result.size() - 13);
719 pos = littleEndian32(pos);
720 uint8_t* data = mutateString(result);
721 memcpy(data + result.size() - sizeof(int32_t), &pos, sizeof(int32_t));
722 return result;
723 }
724
725 Key getRandomVersionStampKey() { return versionStampKeyForIndex(deterministicRandom()->randomInt(0, nodes)); }
726

Callers 1

getRandomVersionStampKeyFunction · 0.85

Calls 8

KeyRefClass · 0.85
getKeyForIndexFunction · 0.85
deterministicRandomFunction · 0.85
mutateStringFunction · 0.85
memcpyFunction · 0.85
toStringMethod · 0.45
randomIntMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected