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

Method put

fdbserver/KeyValueStoreShardedRocksDB.actor.cpp:856–875  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

854 }
855
856 void put(KeyRef key, ValueRef value) {
857 auto it = dataShardMap.rangeContaining(key);
858 if (!it.value()) {
859 TraceEvent(SevError, "ShardedRocksDB").detail("Error", "write to non-exist shard").detail("WriteKey", key);
860 return;
861 }
862 TraceEvent(SevVerbose, "ShardedRocksShardManagerPut", this->logId)
863 .detail("WriteKey", key)
864 .detail("Value", value)
865 .detail("MapRange", it.range())
866 .detail("ShardRange", it.value()->range);
867 ASSERT(it.value()->range == (KeyRangeRef)it.range());
868 ASSERT(writeBatch != nullptr);
869 ASSERT(dirtyShards != nullptr);
870 writeBatch->Put(it.value()->physicalShard->cf, toSlice(key), toSlice(value));
871 dirtyShards->insert(it.value()->physicalShard);
872 TraceEvent(SevVerbose, "ShardedRocksShardManagerPutEnd", this->logId)
873 .detail("WriteKey", key)
874 .detail("Value", value);
875 }
876
877 void clear(KeyRef key) {
878 auto it = dataShardMap.rangeContaining(key);

Callers 15

do_writeFunction · 0.80
setMethod · 0.80
applyMethod · 0.80
smokeTestMethod · 0.80
getLongMethod · 0.80
applyMethod · 0.80
applyMethod · 0.80
fromTuplesMethod · 0.80
applyMethod · 0.80
smokeTestMethod · 0.80
_producerMethod · 0.80
readOldValueMethod · 0.80

Calls 8

TraceEventClass · 0.85
rangeContainingMethod · 0.80
detailMethod · 0.80
toSliceFunction · 0.70
valueMethod · 0.45
rangeMethod · 0.45
PutMethod · 0.45
insertMethod · 0.45

Tested by 13

readOldValueMethod · 0.64
setNewValueAndReadMethod · 0.64
mainMethod · 0.64
checkMethod · 0.64
checkMethod · 0.64
testPackIntoBufferMethod · 0.64
addKpiMethod · 0.64
newTransactionMethod · 0.64
doLogStackMethod · 0.64