Remove outdated code of metabase and localstore
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
869d9e571c
commit
a875d80491
41 changed files with 1725 additions and 3123 deletions
35
pkg/local_object_storage/metabase/small.go
Normal file
35
pkg/local_object_storage/metabase/small.go
Normal file
|
@ -0,0 +1,35 @@
|
|||
package meta
|
||||
|
||||
import (
|
||||
objectSDK "github.com/nspcc-dev/neofs-api-go/pkg/object"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/blobovnicza"
|
||||
"go.etcd.io/bbolt"
|
||||
)
|
||||
|
||||
// IsSmall returns blobovniczaID for small objects and nil for big objects.
|
||||
// Small objects stored in blobovnicza instances. Big objects stored in FS by
|
||||
// shallow path which is calculated from address and therefore it is not
|
||||
// indexed in metabase.
|
||||
func (db *DB) IsSmall(addr *objectSDK.Address) (id *blobovnicza.ID, err error) {
|
||||
err = db.boltDB.View(func(tx *bbolt.Tx) error {
|
||||
id, err = db.isSmall(tx, addr)
|
||||
|
||||
return err
|
||||
})
|
||||
|
||||
return id, err
|
||||
}
|
||||
|
||||
func (db *DB) isSmall(tx *bbolt.Tx, addr *objectSDK.Address) (*blobovnicza.ID, error) {
|
||||
smallBucket := tx.Bucket(smallBucketName(addr.ContainerID()))
|
||||
if smallBucket == nil {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
blobovniczaID := smallBucket.Get(objectKey(addr.ObjectID()))
|
||||
if len(blobovniczaID) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
return blobovnicza.NewIDFromBytes(blobovniczaID), nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue