MCPcopy
hub / github.com/dgraph-io/badger / SetEntryAt

Method SetEntryAt

batch.go:115–121  ·  view source on GitHub ↗

SetEntryAt is the equivalent of Txn.SetEntry but it also allows setting version for the entry. SetEntryAt can be used only in managed mode.

(e *Entry, ts uint64)

Source from the content-addressed store, hash-verified

113// SetEntryAt is the equivalent of Txn.SetEntry but it also allows setting version for the entry.
114// SetEntryAt can be used only in managed mode.
115func (wb *WriteBatch) SetEntryAt(e *Entry, ts uint64) error {
116 if !wb.db.opt.managedTxns {
117 return errors.New("SetEntryAt can only be used in managed mode. Use SetEntry instead")
118 }
119 e.version = ts
120 return wb.SetEntry(e)
121}
122
123// Should be called with lock acquired.
124func (wb *WriteBatch) handleEntry(e *Entry) error {

Callers 3

TestWriteBatchFunction · 0.95
TestWriteBatchManagedFunction · 0.80
TestWriteBatchDuplicateFunction · 0.80

Calls 1

SetEntryMethod · 0.95

Tested by 3

TestWriteBatchFunction · 0.76
TestWriteBatchManagedFunction · 0.64
TestWriteBatchDuplicateFunction · 0.64