MCPcopy Create free account
hub / github.com/nutsdb/nutsdb / getKvEntryNewAddRecordCount

Method getKvEntryNewAddRecordCount

tx.go:366–384  ·  view source on GitHub ↗
(bucketId core.BucketId, entry *core.Entry)

Source from the content-addressed store, hash-verified

364}
365
366func (tx *Tx) getKvEntryNewAddRecordCount(bucketId core.BucketId, entry *core.Entry) (int64, error) {
367 var res int64
368
369 switch entry.Meta.Flag {
370 case DataDeleteFlag:
371 res--
372 case DataSetFlag:
373 if idx, ok := tx.db.Index.BTree.exist(bucketId); ok {
374 _, found := idx.Find(entry.Key)
375 if !found {
376 res++
377 }
378 } else {
379 res++
380 }
381 }
382
383 return res, nil
384}
385
386func (tx *Tx) getSetEntryNewAddRecordCount(_ core.BucketId, entry *core.Entry) (int64, error) {
387 var res int64

Callers 1

Calls 2

existMethod · 0.80
FindMethod · 0.65

Tested by

no test coverage detected