[#1523] blobstor: Unify fstree and blobovnicza interfaces

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-07-08 10:09:48 +03:00 committed by fyrchik
parent 5aa3defc67
commit 266458fe5c
21 changed files with 157 additions and 183 deletions

View file

@ -1,10 +1,7 @@
package blobstor
import (
"errors"
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/blobstor/common"
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/blobstor/fstree"
"go.uber.org/zap"
)
@ -45,12 +42,7 @@ func (b *BlobStor) Exists(prm common.ExistsPrm) (common.ExistsRes, error) {
// checks if object is presented in shallow dir.
func (b *BlobStor) existsBig(prm common.ExistsPrm) (common.ExistsRes, error) {
_, err := b.fsTree.Exists(prm.Address)
if errors.Is(err, fstree.ErrFileNotFound) {
return common.ExistsRes{}, nil
}
return common.ExistsRes{Exists: err == nil}, err
return b.fsTree.Exists(prm)
}
// existsSmall checks if object is presented in blobovnicza.