forked from TrueCloudLab/frostfs-node
[#1412] engine: Add IsIndexedContainer
flag
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
899cd55c27
commit
1b520f7973
19 changed files with 182 additions and 50 deletions
|
@ -4,6 +4,7 @@ import (
|
|||
"errors"
|
||||
|
||||
apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status"
|
||||
containerSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container"
|
||||
cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id"
|
||||
)
|
||||
|
||||
|
@ -20,3 +21,14 @@ func WasRemoved(s Source, cid cid.ID) (bool, error) {
|
|||
}
|
||||
return false, err
|
||||
}
|
||||
|
||||
// IsIndexedContainer returns True if container attributes should be indexed.
|
||||
func IsIndexedContainer(cnr containerSDK.Container) bool {
|
||||
var isS3Container bool
|
||||
cnr.IterateAttributes(func(key, _ string) {
|
||||
if key == ".s3-location-constraint" {
|
||||
isS3Container = true
|
||||
}
|
||||
})
|
||||
return !isS3Container
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue