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

Function decodeServerKeysValue

fdbclient/SystemData.cpp:476–500  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

474}
475
476void decodeServerKeysValue(const ValueRef& value, bool& assigned, bool& emptyRange, UID& id) {
477 if (value.size() == 0) {
478 assigned = false;
479 emptyRange = false;
480 id = UID();
481 } else if (value == serverKeysTrue) {
482 assigned = true;
483 emptyRange = false;
484 id = anonymousShardId;
485 } else if (value == serverKeysTrueEmptyRange) {
486 assigned = true;
487 emptyRange = true;
488 id = anonymousShardId;
489 } else if (value == serverKeysFalse) {
490 assigned = false;
491 emptyRange = false;
492 id = UID();
493 } else {
494 BinaryReader rd(value, IncludeVersion());
495 ASSERT(rd.protocolVersion().hasShardEncodeLocationMetaData());
496 rd >> id;
497 assigned = id.second() != 0;
498 emptyRange = id.second() == emptyShardId;
499 }
500}
501
502const KeyRef cacheKeysPrefix = LiteralStringRef("\xff\x02/cacheKeys/");
503

Callers 3

applyPrivateDataMethod · 0.85
serverHasKeyFunction · 0.85

Calls 5

UIDClass · 0.85
IncludeVersionFunction · 0.85
sizeMethod · 0.45
protocolVersionMethod · 0.45
secondMethod · 0.45

Tested by

no test coverage detected