forked from TrueCloudLab/frostfs-api-go
[#84] object: Regenerate EC-header type
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
parent
9e825239ac
commit
2f6d3209e1
5 changed files with 87 additions and 58 deletions
|
@ -33,6 +33,7 @@ const (
|
|||
ecHdrHeaderField = 5
|
||||
ecHdrParentSplitID = 6
|
||||
ecHdrParentSplitParentID = 7
|
||||
ecHdrParentAttributes = 8
|
||||
|
||||
hdrVersionField = 1
|
||||
hdrContainerIDField = 2
|
||||
|
@ -264,7 +265,10 @@ func (h *ECHeader) StableMarshal(buf []byte) []byte {
|
|||
offset += proto.UInt32Marshal(ecHdrHeaderLengthField, buf[offset:], h.HeaderLength)
|
||||
offset += proto.BytesMarshal(ecHdrHeaderField, buf[offset:], h.Header)
|
||||
offset += proto.BytesMarshal(ecHdrParentSplitID, buf[offset:], h.ParentSplitID)
|
||||
proto.NestedStructureMarshal(ecHdrParentSplitParentID, buf[offset:], h.ParentSplitParentID)
|
||||
offset += proto.NestedStructureMarshal(ecHdrParentSplitParentID, buf[offset:], h.ParentSplitParentID)
|
||||
for i := range h.ParentAttributes {
|
||||
offset += proto.NestedStructureMarshal(ecHdrParentAttributes, buf[offset:], &h.ParentAttributes[i])
|
||||
}
|
||||
return buf
|
||||
}
|
||||
|
||||
|
@ -280,6 +284,9 @@ func (h *ECHeader) StableSize() (size int) {
|
|||
size += proto.BytesSize(ecHdrHeaderField, h.Header)
|
||||
size += proto.BytesSize(ecHdrParentSplitID, h.ParentSplitID)
|
||||
size += proto.NestedStructureSize(ecHdrParentSplitParentID, h.ParentSplitParentID)
|
||||
for i := range h.ParentAttributes {
|
||||
size += proto.NestedStructureSize(ecHdrParentAttributes, &h.ParentAttributes[i])
|
||||
}
|
||||
|
||||
return size
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue