Skip to content

Commit

Permalink
feat: #149, add count in kv root manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
asabya committed Aug 29, 2023
1 parent 9112785 commit 3828ea5
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions pkg/collection/kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,21 +241,6 @@ func (kv *KeyValue) IsEmpty(name string) (bool, error) {
return false, ErrKVTableNotOpened
}

// IsEmpty checks if the given key value table is empty.
func (kv *KeyValue) IsEmpty(name, encryptionPassword string) (bool, error) {
kv.openKVTMu.Lock()
defer kv.openKVTMu.Unlock()
if table, ok := kv.openKVTables[name]; ok {
return table.index.IsEmpty(table.index.encryptionPassword)
} else {
idx, err := OpenIndex(kv.podName, defaultCollectionName, name, encryptionPassword, kv.fd, kv.ai, kv.user, kv.client, kv.logger)
if err != nil {
return true, err
}
return idx.IsEmpty(idx.encryptionPassword)
}
}

// KVPut inserts a given key and value in to the KV table.
func (kv *KeyValue) KVPut(name, key string, value []byte) error {
if kv.fd.IsReadOnlyFeed() { // skipcq: TCV-001
Expand Down

0 comments on commit 3828ea5

Please sign in to comment.