MCPcopy Create free account
hub / github.com/ByteStorage/FlyDB / Put

Method Put

engine/batch.go:37–54  ·  view source on GitHub ↗

Put Data batch write

(key []byte, value []byte)

Source from the content-addressed store, hash-verified

35
36// Put Data batch write
37func (wb *WriteBatch) Put(key []byte, value []byte) error {
38 // Check if the key is empty
39 if len(key) == 0 {
40 return _const.ErrKeyIsEmpty
41 }
42 wb.lock.Lock()
43 defer wb.lock.Unlock()
44
45 // Temporarily store the LogRecord
46 logRecord := &data.LogRecord{
47 Key: key,
48 Value: value,
49 }
50
51 // Add the LogRecord to the temporaryDataWrites map using the key as a string
52 wb.temporaryDataWrites[string(key)] = logRecord
53 return nil
54}
55
56// Delete Batch deletion of data
57func (wb *WriteBatch) Delete(key []byte) error {

Callers 12

StoreLogsMethod · 0.95
TestDB_WriteBatchFunction · 0.95
TestDB_WriteBatchRestartFunction · 0.95
TestDB_WriteBatch1Function · 0.95
HSetMethod · 0.95
HDelMethod · 0.95
HExpireMethod · 0.95
HUpdateMethod · 0.95
HIncrByMethod · 0.95
HIncrByFloatMethod · 0.95
HDecrByMethod · 0.95
HMoveMethod · 0.95

Calls

no outgoing calls

Tested by 3

TestDB_WriteBatchFunction · 0.76
TestDB_WriteBatchRestartFunction · 0.76
TestDB_WriteBatch1Function · 0.76