forked from TrueCloudLab/frostfs-node
[#1175] metabase: Add container bucket for LOCKs
Create class of container buckets with `LOCKED` suffix. Put identifiers of the objects of type `LOCK` to these buckets during `DB.Put`. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
e90ac9c6f9
commit
14d27455f3
2 changed files with 15 additions and 0 deletions
13
pkg/local_object_storage/metabase/lock.go
Normal file
13
pkg/local_object_storage/metabase/lock.go
Normal file
|
@ -0,0 +1,13 @@
|
|||
package meta
|
||||
|
||||
import (
|
||||
cid "github.com/nspcc-dev/neofs-sdk-go/container/id"
|
||||
)
|
||||
|
||||
// suffix for container buckets with locked objects.
|
||||
const bucketNameSuffixLocked = invalidBase58String + "LOCKED"
|
||||
|
||||
// returns name of the bucket with locked objects for specified container.
|
||||
func bucketNameLocked(idCnr cid.ID) []byte {
|
||||
return []byte(idCnr.String() + bucketNameSuffixLocked)
|
||||
}
|
|
@ -198,6 +198,8 @@ func uniqueIndexes(obj *objectSDK.Object, si *objectSDK.SplitInfo, id *blobovnic
|
|||
bucketName = tombstoneBucketName(addr.ContainerID())
|
||||
case objectSDK.TypeStorageGroup:
|
||||
bucketName = storageGroupBucketName(addr.ContainerID())
|
||||
case objectSDK.TypeLock:
|
||||
bucketName = bucketNameLocked(*addr.ContainerID())
|
||||
default:
|
||||
return nil, ErrUnknownObjectType
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue