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

Method ZCheck

tx_zset.go:506–520  ·  view source on GitHub ↗
(bucket string)

Source from the content-addressed store, hash-verified

504}
505
506func (tx *Tx) ZCheck(bucket string) error {
507 if err := tx.checkTxIsClosed(); err != nil {
508 return err
509 }
510
511 b, err := tx.db.bucketMgr.GetBucket(DataStructureSortedSet, bucket)
512 if err != nil {
513 return err
514 }
515 bucketId := b.Id
516 if _, ok := tx.db.Index.SortedSet.exist(bucketId); !ok {
517 return ErrBucket
518 }
519 return nil
520}
521
522// ErrSeparatorForZSetKey returns when zSet key contains the SeparatorForZSetKey flag.
523func ErrSeparatorForZSetKey() error {

Callers 15

ZMembersMethod · 0.95
ZCardMethod · 0.95
ZCountMethod · 0.95
ZPopMaxMethod · 0.95
ZPopMinMethod · 0.95
ZPeekMaxMethod · 0.95
ZPeekMinMethod · 0.95
ZRangeByScoreMethod · 0.95
ZRangeByRankMethod · 0.95
ZRemMethod · 0.95
ZRemRangeByRankMethod · 0.95
ZRankMethod · 0.95

Calls 3

checkTxIsClosedMethod · 0.95
GetBucketMethod · 0.80
existMethod · 0.80

Tested by 1

TestTx_ZCheckFunction · 0.64