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

Function newShardId

fdbclient/SystemData.cpp:412–424  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

410 serverKeysFalse;
411
412const UID newShardId(const uint64_t physicalShardId, AssignEmptyRange assignEmptyRange, UnassignShard unassignShard) {
413 uint64_t split = 0;
414 if (assignEmptyRange) {
415 split = emptyShardId;
416 } else if (unassignShard) {
417 split = 0;
418 } else {
419 do {
420 split = deterministicRandom()->randomUInt64();
421 } while (split == anonymousShardId.second() || split == 0 || split == emptyShardId);
422 }
423 return UID(physicalShardId, split);
424}
425
426const Key serverKeysKey(UID serverID, const KeyRef& key) {
427 BinaryWriter wr(Unversioned());

Callers 1

MoveKeys.actor.cppFile · 0.85

Calls 4

deterministicRandomFunction · 0.85
UIDClass · 0.85
randomUInt64Method · 0.80
secondMethod · 0.45

Tested by

no test coverage detected