forked from TrueCloudLab/frostfs-node
[#176] localstore: Implement shard methods via Metabase and BlobStor
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
b127607ac6
commit
46e455dcae
6 changed files with 154 additions and 8 deletions
21
pkg/local_object_storage/metabase/exists.go
Normal file
21
pkg/local_object_storage/metabase/exists.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
package meta
|
||||
|
||||
import (
|
||||
"github.com/nspcc-dev/neofs-api-go/pkg/object"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// Exists checks if object is presented in metabase.
|
||||
func (db *DB) Exists(addr *object.Address) (bool, error) {
|
||||
// FIXME: temp solution, avoid direct Get usage
|
||||
_, err := db.Get(addr)
|
||||
if err != nil {
|
||||
if errors.Is(err, errNotFound) {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
return false, err
|
||||
}
|
||||
|
||||
return true, nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue