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

Function decodeShardMapping

fdbserver/KeyValueStoreShardedRocksDB.actor.cpp:167–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165}
166
167std::vector<std::pair<KeyRange, std::string>> decodeShardMapping(const RangeResult& result, StringRef prefix) {
168 std::vector<std::pair<KeyRange, std::string>> shards;
169 KeyRef endKey;
170 std::string name;
171
172 for (const auto& kv : result) {
173 auto keyWithoutPrefix = kv.key.removePrefix(prefix);
174 if (name.size() > 0) {
175 shards.push_back({ KeyRange(KeyRangeRef(endKey, keyWithoutPrefix)), name });
176 TraceEvent(SevDebug, "DecodeShardMapping")
177 .detail("BeginKey", endKey)
178 .detail("EndKey", keyWithoutPrefix)
179 .detail("Name", name);
180 }
181 endKey = keyWithoutPrefix;
182 name = kv.value.toString();
183 }
184 return shards;
185}
186
187void logRocksDBError(const rocksdb::Status& status, const std::string& method) {
188 auto level = status.IsTimedOut() ? SevWarn : SevError;

Callers 1

initMethod · 0.85

Calls 8

TraceEventClass · 0.85
detailMethod · 0.80
KeyRangeClass · 0.50
KeyRangeRefClass · 0.50
removePrefixMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected