forked from TrueCloudLab/frostfs-node
[#1141] metabase: Fix IsUserObject
method
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
parent
89a80e9a0f
commit
40b04c00ef
1 changed files with 8 additions and 4 deletions
|
@ -527,10 +527,14 @@ func containerObjectCounterInitialized(tx *bbolt.Tx) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func IsUserObject(obj *objectSDK.Object) bool {
|
func IsUserObject(obj *objectSDK.Object) bool {
|
||||||
|
ech := obj.ECHeader()
|
||||||
|
if ech == nil {
|
||||||
_, hasParentID := obj.ParentID()
|
_, hasParentID := obj.ParentID()
|
||||||
return obj.Type() == objectSDK.TypeRegular &&
|
return obj.Type() == objectSDK.TypeRegular &&
|
||||||
(obj.SplitID() == nil ||
|
(obj.SplitID() == nil ||
|
||||||
(hasParentID && len(obj.Children()) == 0))
|
(hasParentID && len(obj.Children()) == 0))
|
||||||
|
}
|
||||||
|
return ech.Index() == 0 && (ech.ParentSplitID() == nil || ech.ParentSplitParentID() != nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ZeroSizeContainers returns containers with size = 0.
|
// ZeroSizeContainers returns containers with size = 0.
|
||||||
|
|
Loading…
Reference in a new issue