forked from TrueCloudLab/frostfs-sdk-go
[#224] object: Introduce parent attributes in EC-header
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
parent
717a7d00ef
commit
ebd8fcd168
5 changed files with 59 additions and 13 deletions
|
@ -85,10 +85,13 @@ func (c *Constructor) ReconstructParts(parts []*objectSDK.Object, required []boo
|
|||
}
|
||||
|
||||
ec := parts[nonNilPart].GetECHeader()
|
||||
parent := ec.Parent()
|
||||
ecParentInfo := objectSDK.ECParentInfo{
|
||||
ID: ec.Parent(),
|
||||
SplitID: ec.ParentSplitID(),
|
||||
SplitParentID: ec.ParentSplitParentID(),
|
||||
Attributes: ec.ParentAttributes(),
|
||||
}
|
||||
total := ec.Total()
|
||||
splitID := ec.ParentSplitID()
|
||||
parSplitParID := ec.ParentSplitParentID()
|
||||
|
||||
for i := range required {
|
||||
if parts[i] != nil || !required[i] {
|
||||
|
@ -99,8 +102,7 @@ func (c *Constructor) ReconstructParts(parts []*objectSDK.Object, required []boo
|
|||
copyRequiredFields(part, parts[nonNilPart])
|
||||
part.SetPayload(c.payloadShards[i])
|
||||
part.SetPayloadSize(uint64(len(c.payloadShards[i])))
|
||||
part.SetECHeader(objectSDK.NewECHeader(parent, splitID, parSplitParID, uint32(i), total,
|
||||
c.headerShards[i], c.headerLength))
|
||||
part.SetECHeader(objectSDK.NewECHeader(ecParentInfo, uint32(i), total, c.headerShards[i], c.headerLength))
|
||||
|
||||
if err := setIDWithSignature(part, key); err != nil {
|
||||
return err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue