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

Function getCachedKeyRange

fdbserver/StorageCache.actor.cpp:704–718  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

702}
703
704KeyRange getCachedKeyRange(StorageCacheData* data, const KeySelectorRef& sel)
705// Returns largest range that is cached on this server and selectorInRange(sel, range) or wrong_shard_server if no such
706// range exists
707{
708 auto i = sel.isBackward() ? data->cachedRangeMap.rangeContainingKeyBefore(sel.getKey())
709 : data->cachedRangeMap.rangeContaining(sel.getKey());
710
711 if (i->value()->notAssigned())
712 throw wrong_shard_server();
713 else if (!i->value()->isReadable())
714 throw future_version();
715
716 ASSERT(selectorInRange(sel, i->range()));
717 return i->range();
718}
719
720ACTOR Future<Void> getKeyValues(StorageCacheData* data, GetKeyValuesRequest req)
721// Throws a wrong_shard_server if the keys in the request or result depend on data outside this server OR if a large

Callers 2

Future<Void> getKeyFunction · 0.85

Calls 9

selectorInRangeFunction · 0.85
rangeContainingMethod · 0.80
getKeyMethod · 0.65
isBackwardMethod · 0.45
notAssignedMethod · 0.45
valueMethod · 0.45
isReadableMethod · 0.45
rangeMethod · 0.45

Tested by

no test coverage detected